In Selenium Web driver, why we need to set implicit wait to 0 before we use explicit wait ?
2 Answers
Mixed implicit and explicit wait may cause an unexpected timeout.
Doing so can cause unpredictable wait times. For example setting an implicit wait of 10 seconds and an explicit wait of 15 seconds, could cause a timeout to occur after 20 seconds.

- 1,826
- 1
- 20
- 35
Implicit Wait: It is set specifically for an element. When set, if the Web Driver cannot find it immediately because of its availability, it will keep polling (around 250 milli seconds) the DOM to get the element.
If the element is not available within the specified Time an NoSuchElementException will be raised. The default setting is zero
Explicit Wait: Explicit wait is set for the driver.
There can be instance when a particular element takes more than a minute to load. In that case you definitely not like to set a huge time to Implicit wait, as if you do this your browser will going to wait for the same time for every element.
To avoid that situation you can simply put a separate time on the required element only. By following this your browser implicit wait time would be short for every element and it would be large for specific element.
To read and understand more about webdriver waits, read: http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp

- 459
- 4
- 19