zoukankan      html  css  js  c++  java
  • [Selenium] Explicit wait 方法

    (1)  new WebDriverWait(driver, 10). until(ExpectedConditions.elementToBeClickable(locator));

    (2)  new WebDriverWait(driver, 10). until(ExpectedConditions.visibilityOf(locator));

    (3)  new WebDriverWait(driver, 10). until(ExpectedConditions.presenceOfElementLocated(locator);

    (4)

           Function<WebDriver, WebElement> waitFn = new Function<WebDriver, WebElement>() {

                @Override

                public WebElement apply(WebDriver driver) {

                    return el.findElement(By.cssSelector("div.rptstatus.rptcomplete"));

                }

            };

            //Detect every 2 seconds,  the maximum time  is 120 seconds

           WebDriverWait wait = new WebDriverWait(driver, 120, 2);

           wait.withMessage("A processing icon should display in the Status column in the row.”)

           wait.until(waitFn);

  • 相关阅读:
    ubuntu的php7与apache2的环境搭建
    git服务器搭建post-receive 钩子部署服务端代码
    node redis安装与使用
    微信小程序坑集
    微信小程序登录
    mobx react
    react-native-router-flux 下部导航
    java
    java
    java
  • 原文地址:https://www.cnblogs.com/feifeidxl/p/4602646.html
Copyright © 2011-2022 走看看