How to bypass basic authentication ?

868 views
Skip to first unread message

Dan Claudiu Pop

unread,
Aug 25, 2011, 6:51:46 AM8/25/11
to Watir General
Hello,

Are there any new methods that can bypass the basic authentication ?
Passing username and password in url (http://
username:pass...@example.com) will return a confirmation alert. Are
there any workarounds that actually work ?

Alister has a nice post but it's only for IE (http://watirmelon.com/
2010/11/24/elegantly-handling-basic-browser-authentication-with-
watir/), i'm more interested in chrome or firefox.

Thanks,
Dan

Alister Scott

unread,
Aug 29, 2011, 8:52:54 AM8/29/11
to watir-...@googlegroups.com
What watir gem are you using? Watir-WebDriver?
I just tried Watir-WebDriver then with both firefox and chrome and both worked immediately without any problems.

uby-1.9.2-p290 :001 > require "watir-webdriver"
 => true
ruby-1.9.2-p290 :002 > b = Watir::Browser.new
 => #<Watir::Browser:0x..f9578bef11631505a url="about:blank" title="">
ruby-1.9.2-p290 :003 > b.goto "http://admin:pass...@192.168.0.1/"
 => "http://192.168.0.1/setup.cgi?next_file=start.htm"
ruby-1.9.2-p290 :007 > b = Watir::Browser.new :chrome
b.goto  => #<Watir::Browser:0x3785bf4e43b91242 url="about:blank" title="about:blank">
ruby-1.9.2-p290 :008 > b.goto "http://admin:pass...@192.168.0.1/"
 => "http://admin:pass...@192.168.0.1/setup.cgi?next_file=start.htm"

Alister Scott

unread,
Aug 29, 2011, 9:02:51 AM8/29/11
to watir-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages