Examples of ChromeDriver


Examples of org.openqa.selenium.chrome.ChromeDriver


public class ButtonDropdown {

  public static void main(String[] args) throws InterruptedException {
    WebDriver dr = new ChromeDriver();
   
    File file = new File("src/button_dropdown.html");
    String filePath = "file:///" + file.getAbsolutePath();
    System.out.printf("now accesss %s \n", filePath);
   
    dr.get(filePath);
    Thread.sleep(1000);
   
//    ��λtext��watir-webdriver�������˵�
//    ������ʾ�����˵�
    dr.findElement(By.linkText("Info")).click();
   
    (new WebDriverWait(dr, 10)).until(new ExpectedCondition<Boolean>() {
      public Boolean apply(WebDriver d){
        return d.findElement(By.className("dropdown-menu")).isDisplayed();
      }
    });
   
//    ͨ��ul�ٲ㼶��λ
    dr.findElement(By.className("dropdown-menu")).findElement(By.linkText("watir-webdriver")).click();
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.