Selenium implicit wait vs Thread.sleep()

后端 未结 1 1776
一向
一向 2021-02-20 03:42

According to selenium, an implicit wait polls the DOM for a certain amount of time to see if an element shows up. My understanding is that it will poll up to a specified amount

1条回答
  •  情深已故
    2021-02-20 04:39

    Short answer:

    implicit wait - It's global setting applicable for all elements and if element appear before specified time than script will start executing otherwise script will throw NoSuchElementException. Best way to use in setup method. Only affect By.findelement().

    Thread.sleep() - It will sleep time for script, not good way to use in script as it's sleep without condition.

    0 讨论(0)
提交回复
热议问题