How does implicit wait of Protractor interact with explicit wait?

后端 未结 3 934
自闭症患者
自闭症患者 2020-12-16 04:16

The misunderstanding happens when implicit wait is less than explicit:

var timeOut = 5000;
var search = element(by.xpath(`//*[@name=\'qwer\']`));
browser.man         


        
3条回答
  •  伪装坚强ぢ
    2020-12-16 04:59

    The answer is: both waits wait in parallel. Implicit wait polls 4 seconds and returns failure after which explicit wait has waited only 4 seconds and has 1 more to go. This reissues implicit wait again and it polls another 4 seconds and fails again. After 8 seconds (2 attempts of implicit wait) explicit wait of 5 seconds also timed out and we finally we have our error after wasting 3 unexpected seconds. For example in case of Implicit set to 8 and Explicit set to 17 we will wait for 8*3 = 24 seconds. Note that script execution takes some time so if it's slow next iteration might not start.

提交回复
热议问题