Selenium Driver behind a proxy

163 views
Skip to first unread message

Anthony Green

unread,
Mar 17, 2014, 8:24:50 AM3/17/14
to seleniu...@googlegroups.com
I've an issue connecting to the Selenium Hub when developing behind a proxy.

The attempt to connect to "http://127.0.0.1:7055/hub/session" fails as the response that comes back is the proxy's response.
Is there a way of ensure that Selenium Driver uses it's own proxy setting to connect with the hub.
All the information I can find regarding proxies deals only with those related to the browser.

TIA

Anthony

Krishnan Mahadevan

unread,
Mar 18, 2014, 7:29:19 AM3/18/14
to Selenium Users
Anthony
Can you please try using the JVM args : -Dhttp.proxyHost=10.0.0.100 -Dhttp.proxyPort=8800 and pass your corp proxy host and port to the selenium standalone jar and see if that helps ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0f126de4-071b-415f-99bc-5b90a4c0f479%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony Green

unread,
Mar 25, 2014, 6:28:38 AM3/25/14
to seleniu...@googlegroups.com
After some initial investigation the problem may be due to webdriver's use of Ruby's core NET::HTTP class. Making the same request in irb generates the same HTTP 5xx error. 
NET::HTTP appears to be using the system's proxy setting but not the system's no_proxy settings

Amar

unread,
Mar 26, 2014, 2:33:49 AM3/26/14
to seleniu...@googlegroups.com
Anthony,

This is how i connect to proxy using a pac file in my org

my webdriver was global.

              System.setProperty("webdriver.chrome.driver", "C:\\chromedriver.exe");
org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setProxyAutoconfigUrl(PROXY);
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.PROXY, proxy);
d1 = new ChromeDriver(cap);
After this just print whatsmyip.com & it will show you that you are connected via proxy.
Reply all
Reply to author
Forward
0 new messages