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.
What is synchronization? - Selenium Tutorial
From the course: Advanced Selenium: Support Classes
What is synchronization?
- [Instructor] The application we're using is purely browser-based and has no server calls, and so in theory, responds instantly to the messages, showing them in outline view. If I add a hash on the end of this URL, that configures the front end to have a up to two seconds delay. So when I click resend now, we have a delay in the messages being rendered onscreen. And that's to simulate a server responding slowly, which can make the application harder to automate. So in my test examples here in the synchronization example test, I've got a test called whyWaitsAreRequired. And this demonstrates that, if I do not have any waits and I try to find an element, as I do in line 56, then click on it in line 57, then immediately try and assert on the messages, a NoSuchElement exception will be thrown because there's no synchronization. I'll demonstrate this by commenting out the assertion here, and we can see that when this…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.