June 2018
Beginner to intermediate
376 pages
8h 58m
English
The recommended solution for waiting problems is to use explicit waits. There is already a class full of precanned examples called ExpectedConditions to make your life easy, and it really is not that hard to use them. You can do the simple things, such as finding an element once it becomes visible in two lines of code:
WebDriverWait wait = new WebDriverWait(getDriver(), 15, 100);WebElement myElement = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("foo")));
Bear in mind that the ExpectedConditions class are prime examples. While being helpful, they are really designed to show you how to set explicit waits up so that you can easily create your own. With these examples, it is trivial to create a new class ...
Read now
Unlock full access