I am new to automated web testing and I am currently migrating from an old Selenium RC implementation to Selenium 2 in Ruby. Is there a way to halt the execution of commands until the page gets loaded, similar to “wait_for_page_to_load” in Selenium RC?
I am new to automated web testing and I am currently migrating from an
Share
Try using Javascript to inform you!
I created a couple methods that checks via our javascript libraries and waits to see if the page has finished loading the DOM and that all ajax requests are complete. Here’s a sample snippet. The javascript you will need to use is just going to depend on your library.
I then wrapped these methods in a
clickAndWaitmethod that clicks the element and calls the waitForDomLoad and waitForAjaxComplete. Just for good measure, the very next command after a clickAndWait is usually awaitForVisbleelement command to ensure that we are on the right page.