Examples of switchTo()


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

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

    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

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

   
    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

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

    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

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

//    ��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

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

   
//    ֱ����������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

Examples of org.openqa.selenium.phantomjs.PhantomJSDriver.switchTo()

        // Uploading files across a network may take a while, even if they're really small.
        // Wait for the loading label to disappear.
        WebDriverWait wait = new WebDriverWait(phantom, 10);
        wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("upload_label")));

        phantom.switchTo().frame("upload_target");

        wait = new WebDriverWait(phantom, 5);
        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.xpath("//body"), LOREM_IPSUM_TEXT));

        // Navigate after file upload to verify callbacks are properly released.
View Full Code Here

Examples of org.openqa.selenium.remote.RemoteWebDriver.switchTo()

      }

      WebElement email = null;
      while (email == null) {
        try {
          driver.switchTo().window("Web_3");
          email = driver.findElement(By.id("email"));
        } catch (NoSuchElementException e) {
          Thread.sleep(1000);
          System.out.println("not found");
        }
View Full Code Here

Examples of org.openqa.selenium.remote.RemoteWebDriver.switchTo()

  public void switchToAlert() throws Exception {
    RemoteWebDriver d = (RemoteWebDriver) driver;
    By b = By.xpath("//UIAStaticText[@name='Secure Text Input']");
    WebElement el = driver.findElement(b);
    try {
      d.switchTo().alert();
      Assert.fail("should have thrown");
    } catch (NoAlertPresentException e) {
      // expected
    }
    el.click();
View Full Code Here

Examples of org.openqa.selenium.remote.RemoteWebDriver.switchTo()

      Assert.fail("should have thrown");
    } catch (NoAlertPresentException e) {
      // expected
    }
    el.click();
    Alert alert = d.switchTo().alert();
    alert.sendKeys("test");
    alert.accept();
  }

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.