课程: Test Automation with Selenium WebDriver for Java

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Fluent wait

Fluent wait

- [Instructor] Explicit waits allow you to pause your script execution until a certain condition is met. Fluent waits take this concept a step further by offering more flexibility and control. In addition to specifying the maximum amount of time to wait, fluent waits also allow you to specify how often to check for the condition and ignore specific types of exceptions during the wait. This level of control is not available on explicit waits, which by default, checks for the specified condition every 500 milliseconds and only ignores the NoSuchElementException. Let's write a script that uses WebDriver to click the Add a Box button and uses a fluent wait to wait for the red box to appear in the DOM. We'll start by creating an instance of fluent wait. So let's say var wait equals new, and we'll call the FluentWait class. And we'll pass in an instance of our driver. Then we'll use the builder pattern to chain additional methods to configure this fluent wait. To specify the maximum time to…

内容