Search in sources :

Example 86 with Actions

use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.

the class ClickOnWebElement method main.

public static void main(String... args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("file://C:/Selectable.html");
    WebElement one = driver.findElement(By.name("one"));
    WebElement eleven = driver.findElement(By.name("eleven"));
    WebElement five = driver.findElement(By.name("five"));
    int border = 1;
    int tileWidth = 100;
    int tileHeight = 80;
    Actions builder = new Actions(driver);
    //Click on One
    builder.click(one);
    builder.build().perform();
    // Click on Eleven.
    builder.click(eleven);
    builder.build().perform();
    //Click on Five
    builder.click(five);
    builder.build().perform();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 87 with Actions

use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.

the class ContextClick2 method main.

public static void main(String... args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("file://C:/ContextClick.html");
    WebElement contextMenu = driver.findElement(By.id("div-context"));
    Actions builder = new Actions(driver);
    builder.moveToElement(contextMenu).contextClick().click(driver.findElement(By.name("Item 4"))).perform();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 88 with Actions

use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.

the class DoubleClick method main.

public static void main(String... args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("file://C:/DoubleClick.html");
    WebElement dblClick = driver.findElement(By.name("dblClick"));
    Actions builder = new Actions(driver);
    builder.doubleClick(dblClick).perform();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 89 with Actions

use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.

the class MoveByOffsetAndClick2 method main.

public static void main(String... args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("file://C:/Selectable.html");
    WebElement one = driver.findElement(By.name("one"));
    WebElement eleven = driver.findElement(By.name("eleven"));
    WebElement five = driver.findElement(By.name("five"));
    int border = 1;
    int tileWidth = 100;
    int tileHeight = 80;
    Actions builder = new Actions(driver);
    // Click on One
    builder.moveByOffset(one.getLocation().getX() + border, one.getLocation().getY() + border).click();
    builder.build().perform();
    // Click on Eleven.
    builder.moveByOffset(2 * tileWidth + 4 * border, 2 * tileHeight + 4 * border).click();
    builder.build().perform();
    // Click on Five
    builder.moveByOffset(-2 * tileWidth - 4 * border, -tileHeight - 2 * border).click();
    builder.build().perform();
}
Also used : WebDriver(org.openqa.selenium.WebDriver) FirefoxDriver(org.openqa.selenium.firefox.FirefoxDriver) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 90 with Actions

use of org.openqa.selenium.interactions.Actions in project geode by apache.

the class PulseTestUtils method mouseClickAndHoldOverElementById.

public static void mouseClickAndHoldOverElementById(String id) {
    verifyElementPresentById(id);
    Actions action = new Actions(getDriver());
    WebElement we = getDriver().findElement(By.id(id));
    action.moveToElement(we).clickAndHold().perform();
}
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