use of org.openqa.selenium.WebDriver in project java.webdriver by sayems.
the class DragAndDrop method main.
public static void main(String... args) {
WebDriver driver = new FirefoxDriver();
driver.get("file://C:/DragAndDrop.html");
WebElement src = driver.findElement(By.id("draggable"));
WebElement trgt = driver.findElement(By.id("droppable"));
Actions builder = new Actions(driver);
builder.dragAndDrop(src, trgt).perform();
}
use of org.openqa.selenium.WebDriver in project java.webdriver by sayems.
the class DragMe method main.
public static void main(String... args) {
WebDriver driver = new FirefoxDriver();
driver.get("file://C:/DragMe.html");
WebElement dragMe = driver.findElement(By.id("draggable"));
Actions builder = new Actions(driver);
builder.dragAndDropBy(dragMe, 300, 200).perform();
}
use of org.openqa.selenium.WebDriver in project java.webdriver by sayems.
the class MoveByOffset method main.
public static void main(String... args) {
WebDriver driver = new FirefoxDriver();
driver.get("file://C:/Selectable.html");
WebElement three = driver.findElement(By.name("three"));
System.out.println("X coordinate: " + three.getLocation().getX() + " Y coordinate: " + three.getLocation().getY());
Actions builder = new Actions(driver);
builder.moveByOffset(three.getLocation().getX() + 1, three.getLocation().getY() + 1);
builder.perform();
}
use of org.openqa.selenium.WebDriver in project java.webdriver by sayems.
the class MoveByOffsetAndClick method main.
public static void main(String... args) {
WebDriver driver = new FirefoxDriver();
driver.get("file://C:/Selectable.html");
WebElement seven = driver.findElement(By.name("seven"));
System.out.println("X coordinate: " + seven.getLocation().getX() + " Y coordinate: " + seven.getLocation().getY());
Actions builder = new Actions(driver);
builder.moveByOffset(seven.getLocation().getX() + 1, seven.getLocation().getY() + 1).click();
builder.perform();
}
use of org.openqa.selenium.WebDriver in project java.webdriver by sayems.
the class ByCSSSelector method main.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement searchButton = driver.findElement(By.cssSelector("#gbqfba"));
System.out.println(searchButton.getText());
}
Aggregations