Running Selenium backed WebDriver through an authenticated proxy.

307 views
Skip to first unread message

guyht

unread,
Apr 6, 2011, 11:49:42 AM4/6/11
to Selenium Users
I have tried many different solutions but cannot seem to get a
Selenium backed WebDriver to access a site through an authenticated
web proxy in FireFox.


So far I have so far tried everything I can think of, including the
following:
1 Set the proxy up in FireFox, save the password and tell webdriver to
use that specific profile
2 Set a system wide proxy
3 Use foxy proxy on the 'selenium' profile of firefox
4 Use AutoAuth extension to auto complete dialogs

All the above appear to correctly set the proxy, but authentication
_always_ fails.

The best solution so far has been the following that successfully sets
the proxy, but fails on the authentication.

FirefoxProfile profile = new FirefoxProfile();
Proxy proxy = new Proxy();
proxy.setHttpProxy("proxy.location:8080");
profile.setProxyPreferences(proxy);
return new FirefoxDriver(profile);


When I run the tests, I am _not_ confronted with a BasicAuth dialog,
but just presented with an error that I do not have access to the
specified domain.

Looking at the request headers, they are identical apart from this one
(possibly crucial) entry

Proxy-Authorization Basic xxxxxxxxxxxxxxxxxxxxxxx


I am running firefox 3.6 on Ubuntu.

Thanks

G

Guy Halford-Thompson

unread,
Apr 7, 2011, 3:35:26 AM4/7/11
to seleniu...@googlegroups.com

Luke Inman-Semerau

unread,
Apr 8, 2011, 2:57:05 PM4/8/11
to seleniu...@googlegroups.com, Guy Halford-Thompson
Can you try adding the username / password to the url when you try to navigate to the page?
http://username:password@yoururl/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Reply all
Reply to author
Forward
0 new messages