Description
The Implicit Wait in Selenium is used to tell the web driver to wait for a certain amount of time before it throws a "No Such >Element Exception". 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.
That seems nice in theory but in practice, it also create delays where you don't want any.
Some actions, like selecting combobox values, are directly affected by that.
Even when using an explicit timeout, the actual timeout is longer when implicit timeout is present than expected.
Some calls fail to return (I had to put an exception for the #116 by chained implementation to temporarily disable it)
With the new
- Wait-SeDriver
- Wait-SeElement
and existing -Timeout
on Get-SeElement
I believe it might be an enhancement to actually set it to 0 by default.
It will make things generally more responsive.
Explicit wait remain available through the method mentioned above and implicit
It might be a good thing to have an additional Set-SeDriverImplicitWait -Second 4
cmdlet to wrap around $Driver.Manage().Timeouts().ImplicitWait
so it can be toggled on / off very quickly when needed.
Edit:
Also, from official doc: https://www.selenium.dev/documentation/en/webdriver/waits/
There is a second type of wait that is distinct from explicit wait called implicit wait. By implicitly waiting, WebDriver polls the >DOM for a certain duration when trying to find any element. This can be useful when certain elements on the webpage are not >available immediately and need some time to load.
Implicit waiting for elements to appear is disabled by default and will need to be manually enabled on a per-session basis. >Mixing explicit waits and implicit waits will cause unintended consequences, namely waits sleeping for the maximum time even >if the element is available or condition is true.