Should the automation scripts made in Selenium always contain wait calls like implicit, explicit and fluent, or could it be that waits are not needed?

  • 2
    You don't need waits unless you have dynamic interface that takes data from async requests.
    – Alexey R.
    Nov 12, 2021 at 12:12

5 Answers 5


It depends, but probably yes (yes - you should have waits).

If you are interacting with web elements (and you are if you are using Selenium) that implies a network so there will be some change in speed of execution or network conditions that would make the tests without waits indeterministic. So, you will need waits - and which ones will depend on particular conditions of your app.


Wait calls are needed in my experience as long as you never wait for a set amount of time. Always wait only until the System Under Test (SUT) has responded in the way it should do.

Many systems you test might disable a button when you click it and then enable that button again when they are ready to respond to your next instruction. Or you might enter text in a field and then you wait until the OK button becomes enabled. You don't want your test to click on OK button that has not become enabled yet but will be enabled in half a second.

Also note that the checks your test perform on say a buttons enabled state can also impact the responsiveness of the SUT if the SUT runs on the same machine as your test executable. When testing an SUT with slow responsiveness, it is sometimes better to slow down your test and let the SUT catch up.


Selenium scripts doesnt need waits for page loads , selenium scripts need waits when the components are loaded asynchronously


The document.readyState property of a document describes the loading state of the current document. By default, WebDriver will hold off on responding to a driver.get() (or) driver.navigate().to() call until the document ready state is complete

so if the elements are loaded after the document.readystate is set , then you have to use wait


As a regular practice, the majority of the software/security testing services use waits in the selenium automation scripts to avoid fake failures during the script/test-suite execution.

Adding dynamic/Explicit waits to the scripts is considered a good approach because it ensures that elements/pages are loaded successfully before taking any action on the page. To exemplify, if a wait for the element load or a wait for a button to get enabled is missing -> then script will instantly fail which is not the actual results of the test script.


This scenario is faced by every qa person in outsourced software testing company while creating framework.

Most of the applications are developed using Ajax and Javascript. When a page is loaded by the browser the elements which we want to interact with may load at different time intervals. So Automation scripts mostly require waits as script may fail due to pageload issues, or sometimes element is not enabled [ElementNotVisibleException]

So, it is advisable to use waits in frameworks. We can avoid static waits and focus on Implicit, Explicit and Fluent Waits as per the requirement

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.