Package org.openqa.selenium.support.ui

Examples of org.openqa.selenium.support.ui.WebDriverWait


    driverWithReporting.get("http://www.google.com");
    WebElement element = driverWithReporting.findElement(By.name("q"));
    element.sendKeys("Mifos");
    element.submit();
   
        (new WebDriverWait(driverWithReporting, 10))
          .until(ExpectedConditions.presenceOfElementLocated(By.id("bfoot")));
       
        driverWithReporting.quit();
  }
View Full Code Here


      //To use WebDriverWait(), we would have to nullify implicitlyWait().
      //Because implicitlyWait time also set "driver.findElement()" wait time. 
      //info from: https://groups.google.com/forum/?fromgroups=#!topic/selenium-users/6VO_7IXylgY
      driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); //nullify implicitlyWait()
       
      WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
      element = wait.until(ExpectedConditions.visibilityOfElementLocated(by));
     
      driver.manage().timeouts().implicitlyWait(DEFAULT_WAIT_4_PAGE, TimeUnit.SECONDS); //reset implicitlyWait
      return element; //return the element 
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

  public static WebElement waitForElementPresent(WebDriver driver, final By by, int timeOutInSeconds) {
    WebElement element;
    try{
      driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); //nullify implicitlyWait()
     
      WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
      element = wait.until(ExpectedConditions.presenceOfElementLocated(by));
     
      driver.manage().timeouts().implicitlyWait(DEFAULT_WAIT_4_PAGE, TimeUnit.SECONDS); //reset implicitlyWait
      return element; //return the element
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

  public static List<WebElement> waitForListElementsPresent(WebDriver driver, final By by, int timeOutInSeconds) {
    List<WebElement> elements;
    try
      driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); //nullify implicitlyWait()
       
      WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
      wait.until((new ExpectedCondition<Boolean>() {
              @Override
              public Boolean apply(WebDriver driverObject) {
                  return areElementsPresent(driverObject, by);
              }
          }));
View Full Code Here

   public static WebElement waitForElementRefresh(WebDriver driver, final By by,
                                 int timeOutInSeconds) {
    WebElement element;
    try
      driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); //nullify implicitlyWait()
            new WebDriverWait(driver, timeOutInSeconds) {
            }.until(new ExpectedCondition<Boolean>() {

                @Override
                public Boolean apply(WebDriver driverObject) {
                    driverObject.navigate().refresh(); //refresh the page ****************
 
View Full Code Here

    */
  public static boolean waitForTextPresent(WebDriver driver, final By by, final String text, int timeOutInSeconds) {
    boolean isPresent = false;
    try
      driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); //nullify implicitlyWait()
          new WebDriverWait(driver, timeOutInSeconds) {
          }.until(new ExpectedCondition<Boolean>() {
 
              @Override
              public Boolean apply(WebDriver driverObject) {
                return isTextPresent(driverObject, by, text); //is the Text in the DOM
View Full Code Here

  public static boolean waitForJavaScriptCondition(WebDriver driver, final String javaScript,
                               int timeOutInSeconds) {
    boolean jscondition = false;
    try
      driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); //nullify implicitlyWait()
          new WebDriverWait(driver, timeOutInSeconds) {
          }.until(new ExpectedCondition<Boolean>() {
 
              @Override
              public Boolean apply(WebDriver driverObject) {
                return (Boolean) ((JavascriptExecutor) driverObject).executeScript(javaScript);
View Full Code Here

   * */
  public static boolean waitForJQueryProcessing(WebDriver driver, int timeOutInSeconds){
    boolean jQcondition = false;
    try
      driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); //nullify implicitlyWait()
          new WebDriverWait(driver, timeOutInSeconds) {
          }.until(new ExpectedCondition<Boolean>() {
 
              @Override
              public Boolean apply(WebDriver driverObject) {
                return (Boolean) ((JavascriptExecutor) driverObject).executeScript("return jQuery.active == 0");
View Full Code Here

     */
    private String waitForConsumerWindowLoadingAfterInvocation(final int currentNumberOfConsumerWindows, Set<String> oldWindows) {

        webDriver.findElement(MESSAGE_CONSUMER_INVOKE_LINK).click();

        (new WebDriverWait(webDriver, 4)).until(new ExpectedCondition<Boolean>() {

            public Boolean apply(WebDriver d) {

                return (d.getWindowHandles().size() - 1) > currentNumberOfConsumerWindows;
            }
View Full Code Here

    @Test
    public void testResizingSplitPanelReflowsLayout() throws Exception {
        openTestURL();

        // IE sometimes has trouble waiting long enough.
        new WebDriverWait(getDriver(), 30).until(ExpectedConditions
                .presenceOfElementLocated(By
                        .cssSelector(".v-csslayout-grid.first")));

        assertEquals("401px-600px",
                $(".v-csslayout-grid.first").getAttribute("width-range"));
View Full Code Here

TOP

Related Classes of org.openqa.selenium.support.ui.WebDriverWait

Copyright © 2018 www.massapicom. 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.