Search in sources :

Example 46 with Actions

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();
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 47 with Actions

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;
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 48 with Actions

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();
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 49 with Actions

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();
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 50 with Actions

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));
}
Also used : Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Aggregations

Actions (org.openqa.selenium.interactions.Actions)116 WebElement (org.openqa.selenium.WebElement)72 WebDriver (org.openqa.selenium.WebDriver)26 Test (org.junit.Test)21 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)18 PublicAtsApi (com.axway.ats.common.PublicAtsApi)16 Action (org.openqa.selenium.interactions.Action)10 HiddenHtmlElementState (com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState)9 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)6 RealHtmlElementState (com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState)4 List (java.util.List)3 MobileOperationException (com.axway.ats.uiengine.exceptions.MobileOperationException)2 VerificationException (com.axway.ats.uiengine.exceptions.VerificationException)2 MobileElementState (com.axway.ats.uiengine.utilities.mobile.MobileElementState)2 AndroidDriver (io.appium.java_client.android.AndroidDriver)2 File (java.io.File)2 DecimalFormat (java.text.DecimalFormat)2 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)2 SystemException (com.github.bordertech.wcomponents.util.SystemException)1 VerticalLayoutElement (com.vaadin.testbench.elements.VerticalLayoutElement)1