From the course: Advanced Selenium: 3 Synchronization Strategies

Unlock the full course today

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

Creating your waiting libraries

Creating your waiting libraries - Selenium Tutorial

From the course: Advanced Selenium: 3 Synchronization Strategies

Start my 1-month free trial

Creating your waiting libraries

- We have now seen multiple approaches to waiting and creating expected conditions. Most of the time, my synchronization code will be in components and page objects. If I need to reuse custom synchronization strategies across page objects, then I create a set of custom wait library code. And that's what I'm going to demonstrate now using this create custom wait library test. So I have two tests in here and they have some sort of synchronization already. At this point I'm going to be refactoring them to make the synchronization more generic and readable. So this can click on second buttons test is the normal test that clicks on the buttons and checks the messages. And I've currently coded it to use WebDriverWait and expected conditions. Ideally, I'd like this to be a bit more readable so I'm going to create a waiting class. And this will be, course, new waiting and that will take a driver. 'Cause I like to instantiate…

Contents