use of org.openqa.selenium.WebElement 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.WebElement 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.WebElement 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());
}
use of org.openqa.selenium.WebElement in project java.webdriver by sayems.
the class isDisplayed method main.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement searchButton = driver.findElement(By.name("btnK"));
System.out.println(searchButton.isDisplayed());
}
use of org.openqa.selenium.WebElement in project java.webdriver by sayems.
the class isEnabled method main.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement searchButton = driver.findElement(By.name("btnK"));
System.out.println(searchButton.isEnabled());
}
Aggregations