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