In This Course
In this course, you will:
1. Learn the problems that can occur as a result of improper synchronization
2. Learn how to use Selenium Webdriver explicit waits
3. Master Selenium Webdriver implicit wait
4. Understand what a DefaultWait is
5. Comprehend how to use all of the different types of waits during appropriate situations
In this Lecture
This lecture emphasizes on not mixing implicit and explicit waits when using WebDriverWait. It also discuses on what could happen when you mix the two. You’ll also learn which one of them is best when working with WebDriverWait.
Selenium Tutorial – Don’t Mix Implicit and Explicit Waits
A few final words on the WebDriverWait, I want to mention to you guys to try and use this explicit wait to may be this kind of style of waiting for your elements rather using implicit waits. This obviously has a lot of benefits and that is very dynamic. You can control it from a single place and any time you need to implement this waiting condition, you can go ahead and do so.
The other thing that I wanted to mention is to actually not mix implicit and explicit waits so don’t create a driver and implicitly set a timeout and then also try to use explicit waits at the same time.
According to Jim Evans, one of the creators of Selenium, that actually leads to unexpected behavior in Selenium Webdriver. It just basically has to do with how the implicit wait and the explicit waits are implemented. When you mix them you get into an unknown territory where the waiting period may be unknown and when you progressed to the remote webDriver level, it gets more complicated because that’s another extra hop that Selenium has to make from your local code to Java machines to your browser to the remote browser.
All those extra hops can cause some complexities and therefore you should not be mixing implicit than explicit waits rather I recommend that you just used explicit waits like this throughout your code and wait for elements in that manner.
Now let’s move on to one final type of wait that I wanted to show you guys