问题
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