Package org.openqa.selenium.remote

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


  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

      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

    Alert alert = waitForAlert(driver);
    alert.dismiss();

    try {
      d.switchTo().alert();
      Assert.fail("alert should be gone.");
    } catch (NoAlertPresentException e) {
      // expected
    }
  }
View Full Code Here

    Alert alert = waitForAlert(driver);
    alert.accept();

    try {
      d.switchTo().alert();
      Assert.fail("alert should be gone.");
    } catch (NoAlertPresentException e) {
      // expected
    }
  }
View Full Code Here

    alert.sendKeys("test");
    Assert.assertEquals(field.getAttribute("value"), "••••");
    alert.accept();

    try {
      d.switchTo().alert();
      Assert.fail("alert should be gone.");
    } catch (NoAlertPresentException e) {
      // expected
    }
  }
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.