码迷,mamicode.com
首页 > 其他好文 > 详细

Explicit wait 方法

时间:2015-06-26 17:36:24      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:

(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);

Explicit wait 方法

标签:

原文地址:http://www.cnblogs.com/feifeidxl/p/4602646.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!