Search in sources :

Example 76 with Actions

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

the class Action method offsetClick.

public void offsetClick(Supplier<By> by, int x, int y) {
    Actions action = new Actions(driver);
    action.moveToElement(driver.findElement(by.get()), x, y).click().build().perform();
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 77 with Actions

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

the class Action method rightClick.

public void rightClick(Supplier<By> by) {
    Actions hover = new Actions(driver);
    hover.contextClick(driver.findElement(by.get())).build().perform();
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 78 with Actions

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

the class Action method pageUp.

public void pageUp() {
    Actions clicker = new Actions(driver);
    clicker.sendKeys(Keys.PAGE_DOWN);
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

Example 79 with Actions

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

the class SwitchBetweenFrames method main.

public static void main(String... args) {
    WebDriver driver = new FirefoxDriver();
    driver.get("file://///vmware-host/Shared Folders/Desktop/IFrames.html");
    Actions action = new Actions(driver);
    driver.switchTo().frame(0);
    WebElement txt = driver.findElement(By.name("1"));
    txt.sendKeys("I'm Frame One");
    driver.switchTo().defaultContent();
    driver.switchTo().frame(1);
    txt = driver.findElement(By.name("2"));
    txt.sendKeys("I'm Frame Two");
}
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 80 with Actions

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

the class Action method scrollDown.

//scrolling down using Actions class
public void scrollDown() {
    Actions action = new Actions(driver);
    action.keyDown(Keys.CONTROL).sendKeys(Keys.END).perform();
}
Also used : Actions(org.openqa.selenium.interactions.Actions)

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