Instantiating RemoteWebDriver fails and Selenium.WebDriver 3.10.0 + doesn't use default system proxy
See original GitHub issueMeta
OS: Windows 10 Selenium Version: Selenium.WebDriver 3.10.0 or 3.11.0 or 3.11.1 - C#, .NET 4.6.1 Browser: RemoteWebDriver
Browser Version: na
Expected Behavior
Attempting to instantiate a new RemoteWebDriver instance behind a corporate proxy (which is the system default proxy) should work, given that the proxy allows that traffic. This works fine with Selenium.WebDriver 3.9.1 (and previous versions)
Actual Behavior
Attempting to instantiate a new RemoteWebDriver with 3.10.0 and above fails - it appears that the request does not go via the proxy as previously.
Looking at issue #4478 I’ve tried to implement the code as provided by Jim that will implement a BeforeRemoteHttpRequest event, but the method that hooks into that event never gets hit (my code is identical to that provided in #4478)
Steps to reproduce
Even if you explicitly set the proxy configuration in App.Config like so, this appears to be ignored whereas 3.9.1 will use this configuration.
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy proxyaddress="<proxy_url>" />
</defaultProxy>
</system.net>
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
In the currently released binaries, if you set the Proxy property within the event handler, an exception will be thrown. And no, the system proxy is not being used at present. Going forward, creating your own
HttpCommandExecutor
and using the event handler will be the only way to set a proxy for aRemoteWebDriver
instance to use between the C# code and the Java remote server/grid.The code you’re using looks correct; I cannot speak to why your event handler isn’t getting invoked. That does not happen for me.
This issue has now been resolved with the 3.12.0 release and ability to successfully use a HttpCommandExecutor and explicitly set the proxy in the SendingRemoteHttpRequest event handler. Thanks 😃