Selenium WebDriver does it understand page loads now?

喜夏-厌秋 提交于 2019-12-08 09:09:01

问题


With the current form of Selenium WebDriver does it understand page loads now?

In my recent research comparing WatiN vs Selenium vs X one of the biggest points I've seen in favor of WatiN was that it understands the concept of a page is loaded, whereas atleast on older versions of Selenium you had to fake this using waits/thread sleeps etc.

Is this now no longer a valid negative against Selenium?


回答1:


Yes, many of the functions in Selenium WebDriver return only after the page has loaded. In other words, many of the old -action-andwait functions have just become -action-.

Looking at the documentation can tell you exactly which functions block and which don't wait for the page to load. For example, here is a snippet of the click function description:

Click this element. If this causes a new page to load, this method will block until the page has loaded.



来源:https://stackoverflow.com/questions/7799299/selenium-webdriver-does-it-understand-page-loads-now

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!