
#Webdrive implicit vs explicit wait driver
The Explicit Wait tells the Selenium web driver to wait for certain conditions or maximum time exceeded before throwing the ElementNotVisibleException exception. The driver will not continue after 2 seconds, it will slow down the automation process.Let's say you have set an implicit wait of 5 sec, and the driver can identify the web element in 2 seconds, as you have applied implicit wait driver will wait for 3 more seconds (till 5 seconds).If you use the implicit wait in selenium it applies to the web driver globally and increases the execution time for the entire script.
So it slows down the testing of your automation script, as the driver has to wait for a specific amount of time. The implicit wait applies to all the future commands utilized in your test. If the element is there but it's simply just hidden on the page, the implicit wait will not work and it will fail immediately. It means that if the element is not located on the web page within that time frame, it will throw an exception. webDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(2) In the following example, we have declared an implicit wait with the time frame of 3 seconds. The default setting is 0, once we set the time, the web driver will wait for the element for that time before throwing an exception. So it's checking the DOM to see if that element is present if it's not present it's going to keep checking for a specific duration of time. The Implicit Wait tells the Selenium web driver to wait for a certain amount of time when trying to find an element or elements if they are not immediately available before it throws a NoSuchElementException. This problem can be resolved with waits and Selenium provides two types of waits. In most of the web applications, Ajax and Javascript are used and when a page is loaded by the browser the elements which we want to interact with may load at different time intervals which makes it difficult to identify the element but also if the element is not located it will throw an ElementNotVisibleException exception. Selenium-webdriver with Python, Ruby and Javascript along with CI tool.
Error Handling in Automation using Selenium.Actions (Emulating complex user gestures).Getting started with selenium-webdriver.