Is there any way I can check whether a particular page completely loaded or not using Watir?
I tried with browser.status
but it's not printing anything.
Is there any way I can check whether a particular page completely loaded or not using Watir?
I tried with browser.status
but it's not printing anything.
Depending on what you mean by completely loaded? All HTML or all HTML and JavaScripts.
For HTML
browser = Watir::Browser.new
#To check if page has been loaded
ready = browser.ready_state.eql? "complete"
#To wait until page has been loaded
browser.wait
For JavaScript and HTML. For these you have to wait for each specific element This code will wait until the element i enable, meaning clickable.
browser = Watir::Browser.new
browser.text_field(:id => 'id_of_object').wait_until_present