skip to main
|skip to sidebarWaitForCondition(string arg0) or Wait() in Selenium?
What is better to use: WaitForCondition(string arg0) or Wait() in Selenium?The two methods WaitForCondition(string arg0) and Wait() vary in their efficiency in terms of speed.I prefer to use WaitForCondition(string arg0) or WaitForPageToLoad(string arg0,string arg1). The reason is that the wait interval of Wait() function is limited by the value specified as an argument. And the wait interval is always fixed. So we&;ll not save time if the server response was fast because the method will always wait for a fixed interval.For example, if we say Wait(3000), it will wait for 3 seconds regardless of the speed of browser rendering. On the other hand, the other two methods check if the condition is met every small fraction of a second. And this way the wait interval is elastic and will accommodate to the speed of browser rendering.