use of org.openqa.selenium.WebDriver 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.WebDriver 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());
}
use of org.openqa.selenium.WebDriver in project java.webdriver by sayems.
the class GetWindowName method main.
public static void main(String[] args) {
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.navigate().to("http://www.google.com");
JavascriptExecutor js = (JavascriptExecutor) driver;
System.out.println(js.executeScript("return window.name"));
}
use of org.openqa.selenium.WebDriver in project java.webdriver by sayems.
the class ImplicitWaitTime method main.
public static void main(String... args) {
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("www.google.com");
}
use of org.openqa.selenium.WebDriver in project java.webdriver by sayems.
the class GetAttributes 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("Name of the button is: " + searchButton.getAttribute("name"));
System.out.println("Id of the button is: " + searchButton.getAttribute("id"));
System.out.println("Class of the button is: " + searchButton.getAttribute("class"));
System.out.println("Label of the button is: " + searchButton.getAttribute("aria- label"));
}
Aggregations