Basic Browser Authentication

Edit on GitHub

The easiest and most elegant way to handle basic browser authentication is to supply the username and password in the URL, bypassing the dialog altogether.

require 'watir'
b = Watir::Browser.start 'http://admin:password@yourwebsite.com'

Proxy Authentication

If the above method doesn’t work, eg. you are authenticating against a NTLM proxy, you may have find using the AutoAuth Firefox extension will enable you to automatically dismiss this dialog with your credentials. See this blog post for full details.