use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.
the class Action method pressEnterKey.
// Method to Press Enter Key
public void pressEnterKey() {
Actions action = new Actions(driver);
action.sendKeys(Keys.ENTER).build().perform();
}
use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.
the class Action method dragDrop.
//drag and drop function build.dragAndDrop
public Actions dragDrop(Supplier<By> drag, Supplier<By> drop) {
Actions build = new Actions(driver);
build.dragAndDrop(driver.findElement(drag.get()), driver.findElement(drop.get())).perform();
return build;
}
use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.
the class Action method hoverAndClick.
//for hover and click using svg xpath element
public void hoverAndClick(Supplier<By> by) {
Actions hover = new Actions(driver);
hover.moveToElement(driver.findElement(by.get())).build().perform();
driver.findElement(by.get()).click();
}
use of org.openqa.selenium.interactions.Actions in project hippo by NHS-digital-website.
the class SitePage method clickOnElement.
public void clickOnElement(WebElement element) {
// scroll to element to prevent errors like "Other element would receive the click"
new Actions(getWebDriver()).moveToElement(element).moveByOffset(0, 100).perform();
// click it
element.click();
}
use of org.openqa.selenium.interactions.Actions in project hippo by NHS-digital-website.
the class GranularityCmsWidget method addGranularityField.
public void addGranularityField() {
// get element
WebElement addButton = helper.findElement(By.xpath(ROOT_ELEMENT_XPATH + "//a[contains(@class, 'add-link')]"));
// scroll to element, to preven errors like "Other element would receive the click"
new Actions(webDriver).moveToElement(addButton).moveByOffset(0, 200).perform();
// click
addButton.click();
// wait after click for the dropdown to appear
helper.findElement(By.xpath(DROPDOWN_XPATH));
}
Aggregations