Method: Selenium::Client::GeneratedDriver#wait_for_page_to_load

Defined in:
lib/selenium/client/legacy_driver.rb

#wait_for_page_to_load(timeout) ⇒ Object

Waits for a new page to load.

You can use this command instead of the “AndWait” suffixes, “clickAndWait”, “selectAndWait”, “typeAndWait” etc. (which are only available in the JS API). Selenium constantly keeps track of new pages loading, and sets a “newPageLoaded” flag when it first notices a page load. Running any other Selenium command after turns the flag to false. Hence, if you want to wait for a page to load, you must wait immediately after a Selenium command that caused a page-load.

‘timeout’ is a timeout in milliseconds, after which this command will return with an error

[View source]

1426
1427
1428
# File 'lib/selenium/client/legacy_driver.rb', line 1426

def wait_for_page_to_load(timeout)
    remote_control_command("waitForPageToLoad", [timeout,])
end