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.

WebDriver synchronized components

WebDriver synchronized components - Selenium Tutorial

From the course: Advanced Selenium: 3 Synchronization Strategies

Start my 1-month free trial

WebDriver synchronized components

- [Instructor] One of the patterns we often use when automating is an abstraction class. And in this test the slow and loadable example test, let me expand this or contract this so you can see it. This test uses a button component. You can see it in use here on line 30. I instantiate a button component taking a driver and a locator and then I wait until that button is ready then I click on it. So all the work, the synchronization, the locating, everything like that is done in the button component itself. And if I look at the button component by command + click or control + click on Windows then we can see the button component is a very, very simple class. I've made it an inner class just for the sake of this course to keep all of the source files in the same place. Normally this would be an external class. And this has a wait 'til ready method on line 39 that performs the synchronization. And it's using standard web driver…

Contents