Stop loading page watir-webdriver
You can use the Timeout class to force it to give up after waiting a reasonable amount of time (and this is internally how Watir performs it's waits as well)
begin
Timeout::timeout(10) do
# perform actions that may hang here
end
rescue Timeout::Error => msg
put "Recovered from Timeout"
end
Watir Webdriver : How can I disable loading ads using watir
This isn't really watir-related, but you could set the ad-host URL to 127.0.0.0 in your hosts file. This would cause those ads to resolve instantly the host and the ads to never load.
Windows:
- windows/system32/drivers/etc/hosts
OSX:
/private/etc/hosts
ads.advertiserswebhost.com 127.0.0.0
How to deal with a page which fails to load and continue testing in Watir-Webdriver
I am not sure how would you test a page that did not load, but try something like this:
begin
browser.goto "http://www.mycounciltax.org.uk/results?postcode=WC1N1DF&search=Search"
rescue => e
puts "rescued #{e}"
end
Related Topics
Make Rails Ignore Daylight Saving Time When Displaying a Date
Undefined Method 'Name' for "Actionmailer":String
How to Receive a JSON Object with Rack
Getting a List of Classes That Include a Module
How to Override [] Brackets in Ruby
Rails Shows "Warning: Can't Verify Csrf Token Authenticity" from a Restkit Post
Ruby: Converting from Float to Integer in Ruby Produces Strange Results
Rails 3, Displaying Jpg Images from the Local File System Above Rails_Root
Error Loading Media: File Could Not Be Played Error in Jw_Player Rails
Dynamic Active Record Store Accessors Based Off a User Form
How to Memoize a Method That May Return True, False, or Nil in Ruby
Changing Songs on Jplayer by Clicking a Link, Hosted on Amazon S3
Check to See If an Array Is Already Sorted
Using Phonegap as a Native Container for a Rails 3 App