Watir-webdriver: how to make the click method wait for the page to fully load

I recently started using Watir-Webdriver after I used Watir before, as I needed some kind of functionality that was present in the webdriver, but not in Watir. I ran into a problem in watir-webdriver that I never encountered in Vatir.

Whenever you used the click method on a button in Watir, it implicitly waited for the new page to load completely. I read in the Watir-webdriver docs that expectations and in this question the expectation in watir-webdriver has been changed to accommodate the dynamic changes made to the web page created by AJAX. Now on the page I am automating, there are no AJAX elements, it contains only static elements.

But when I used the click method in watir-webdriver, it does not wait for the next page to load implicitly and immediately executes the next line in the call. I could use wait_until_present, but for this, for a large number of pages, it seems redundant to me, expecting the page to be loaded with a click seems standard.

Am I missing some parameters that I need to switch in order for the Watrit click method to be emulated in watir-webdriver?

+3
source share
2 answers

, , , ( , javascript, css- ..), 'when_present' decorator .

, ..

browser.button(:how => 'what').when_present.click
+1

div, , , .

browser.div(:how => 'what').wait_until_present
+1

All Articles