From the course: Advanced Selenium: Support Classes

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

FluentWait: Waiting for anything

FluentWait: Waiting for anything - Selenium Tutorial

From the course: Advanced Selenium: Support Classes

Start my 1-month free trial

FluentWait: Waiting for anything

- [Instructor] So now we will examine WebDriver wait in more detail to see how flexible it is. WebDriver provides a lot of configuration methods, and it does it in a fluent interface. So here I have a test, explicitWaitIsFluent. And I've added a TODO for myself to remind myself that I want to customize this wait. I'm going to change the default timeout message to say that it cannot find a message. So, Could not find a Message. Let's put this on a new line so we can read it. And then the fluent interface is obvious when I do dot and get the code completion up. So I'm going to add a polling time. So I'm going to say pollingEvery and let's see, five, 50 milliseconds. Duration.ofMillis, 50. So normally WebDriverWait will poll every 100 milliseconds, this WebDriverWait will poll every 50 milliseconds. And I'm going to make it ignore the stale element exceptions. So StaleElementReferenceException, and that's the class we pass…

Contents