January 2018
Beginner to intermediate
354 pages
7h 59m
English
Combining the two sets of methods into a wrapper method will allow users to synchronize the scripts on a variety of conditions that might exist on a web or mobile page. The following are examples of wrapper methods that wait for elements to become visible or invisible:
/** * waitFor method to wait up to a designated period before * throwing exception (static locator) * * @param element * @param timer * @throws Exception */public static void waitFor(WebElement element, int timer) throws Exception { WebDriver driver = CreateDriver.getInstance().getDriver(); // wait for the static element to appear WebDriverWait exists = new WebDriverWait(driver, timer); exists.until(ExpectedConditions.refreshed( ExpectedConditions. ...
Read now
Unlock full access