Try using Javascript to report it!
I created a couple of methods that check through our javascript libraries and wait for the page to finish loading the DOM and that all ajax requests are complete. Here is an example fragment. The javascript you need to use just depends on your library.
Selenium::WebDriver::Wait.new(:timeout => 30).until { @driver.execute_script("[use javascript to return true once loaded, false if not]"}
Then I wrapped these methods in the clickAndWait method, which clicks on the element and calls waitForDomLoad and waitForAjaxComplete. For a good estimate, the very next command after clickAndWait is usually the waitForVisble element waitForVisble to make sure that we are on the correct page.
# Click element and wait for page elements, ajax to complete, and then run whatever else def clickElementAndWait(type, selector) @url = @driver.current_url clickElement(type, selector)
bbbco
source share