Package org.openqa.selenium

Examples of org.openqa.selenium.Alert.sendKeys()


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


  @DataProvider(name = "allAlerts")
View Full Code Here


    WebElement el = driver.findElement(b);
    el.click();

    Alert alert = waitForAlert(driver);
    try {
      alert.sendKeys("test");
      Assert.fail("should crash on sendKeys");
    } catch (InvalidElementStateException e) {
      //expected
    }
    alert.dismiss();
View Full Code Here

    el.click();

    Alert alert = waitForAlert(driver);
    WebElement field = driver.findElement(By.xpath("//UIAAlert//UIASecureTextField"));
    Assert.assertEquals(field.getAttribute("value"), "");
    alert.sendKeys("test");
    Assert.assertEquals(field.getAttribute("value"), "••••");
    alert.accept();

    try {
      d.switchTo().alert();
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.