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();
}
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();
}
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);
}
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");
}
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();
}
Aggregations