use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.
the class Action method mouseOverAndClick.
// Method to mouse hover to an element and click
public void mouseOverAndClick(Supplier<By> from, Supplier<By> to) {
Actions action = new Actions(driver());
action.moveToElement(driver.findElement(from.get())).moveToElement(driver.findElement(to.get())).click().build().perform();
}
use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.
the class Action method dragDropClickMoveRelease.
//drag and drop function using clickAndHold, moveToElement & release with Lint Text
public Actions dragDropClickMoveRelease(Supplier<By> from, Supplier<By> to) {
Actions build = new Actions(driver);
build.clickAndHold(driver.findElement(from.get())).build().perform();
build.moveToElement(driver.findElement(to.get())).build().perform();
build.release(driver.findElement(to.get())).perform();
return build;
}
use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.
the class ActionBuildPerform2 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 three = driver.findElement(By.name("three"));
WebElement five = driver.findElement(By.name("five"));
// Add all the actions into the Actions builder.
Actions builder = new Actions(driver);
builder.keyDown(Keys.CONTROL).click(one).click(three).click(five).keyUp(Keys.CONTROL);
// Perform the action.
builder.perform();
}
use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.
the class ClickAndHoldAndRelease method main.
public static void main(String... args) {
WebDriver driver = new FirefoxDriver();
driver.get("file://C:/Sortable.html");
WebElement three = driver.findElement(By.name("three"));
Actions builder = new Actions(driver);
// Move tile3 to the position of tile2
builder.clickAndHold(three).moveByOffset(120, 0).release().perform();
}
use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.
the class ClickAndHoldAndReleaseOnWebElement method main.
public static void main(String... args) {
WebDriver driver = new FirefoxDriver();
driver.get("file://C:/Sortable.html");
WebElement three = driver.findElement(By.name("three"));
WebElement two = driver.findElement(By.name("two"));
Actions builder = new Actions(driver);
// Move tile3 to the position of tile2
builder.clickAndHold(three).release(two).perform();
}
Aggregations