2.5 Wait Time
The implicit wait command in the below code makes selenium wait maximum of 30 seconds before throwing an error. If the element is found in less than 30 seconds then the wait is stopped and the element is acted upon.
In the code below we check every 1 second if the element is present. Once the element is present, the loop breaks and the element is acted upon.
In the code below we define the wait time and wait for the element to meet the condition like being Clickable.
We can also use explicit waits using Thread.sleep method. In the code below we halt the code execution for 5 seconds.
Last updated
Was this helpful?