Package org.openqa.selenium.chrome

Examples of org.openqa.selenium.chrome.ChromeDriver.switchTo()


    Thread.sleep(1000);
   
//    ����ύ��ť
    dr.findElement(By.cssSelector("input[type=submit]")).click();
   
    Alert alert = dr.switchTo().alert();
    System.out.println(alert.getText());
    alert.accept();
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
View Full Code Here


    Thread.sleep(1000);
   
//    ������ӵ���alert
    dr.findElement(By.id("tooltip")).click();
   
    Alert alert = dr.switchTo().alert();
    alert.accept();
           
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
View Full Code Here

   
    dr.get(filePath);
    Thread.sleep(1000);
   
//     �ȵ�f1�ٵ�f2
    dr.switchTo().frame("f1");
    dr.switchTo().frame("f2");
//    ��f2�еİٶȹؼ����ı�������������
    dr.findElement(By.id("kw")).sendKeys("watir-webdriver");
    Thread.sleep(1000);
   
View Full Code Here

    dr.get(filePath);
    Thread.sleep(1000);
   
//     �ȵ�f1�ٵ�f2
    dr.switchTo().frame("f1");
    dr.switchTo().frame("f2");
//    ��f2�еİٶȹؼ����ı�������������
    dr.findElement(By.id("kw")).sendKeys("watir-webdriver");
    Thread.sleep(1000);
   
//    ֱ����������frame
View Full Code Here

//    ��f2�еİٶȹؼ����ı�������������
    dr.findElement(By.id("kw")).sendKeys("watir-webdriver");
    Thread.sleep(1000);
   
//    ֱ����������frame
    dr.switchTo().defaultContent();

//    �ٵ�f1
    dr.switchTo().frame("f1");
    dr.findElement(By.linkText("click")).click();
   
View Full Code Here

   
//    ֱ����������frame
    dr.switchTo().defaultContent();

//    �ٵ�f1
    dr.switchTo().frame("f1");
    dr.findElement(By.linkText("click")).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.