3
votes

I am trying to automate a website, but what is happening is that the ads are taking very long to load thus the complete suite is taking a long time to complete.

Is there a way I can disable loading ads using watir webdriver ? I don't want to disable it on the browser as I have to test ad slots on the website as well.

1

1 Answers

5
votes

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