1

I need to authenticate against a proxy server using a domain, username and password before my selenium tests will run when executed by our build server.

I know about the Proxy object, but I'm unsure how to set the HttpProxy property correctly.

When run by our build server, I get the following exception:

System.InvalidOperationException : session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"3372.1","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: Opera with embedded Chromium 54.0.2840.87)
(Driver info: OperaDriver=0.2.0 (ba47709ed9e35ce26dbd960fb5d75be104290d96),platform=Windows NT 6.3 x86_64) (33)
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
Stack Trace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Opera.OperaDriver..ctor(OperaDriverService service, OperaOptions options, TimeSpan commandTimeout)
at OpenQA.Selenium.Opera.OperaDriver..ctor(String operaDriverDirectory, OperaOptions options, TimeSpan commandTimeout)
at OpenQA.Selenium.Opera.OperaDriver..ctor(String operaDriverDirectory, OperaOptions options)

I've tried using netsh winhttp to set proxy settings at the system level but this doesn't appear to have made a difference

Braydie
  • 716
  • 9
  • 27
  • Possible duplicate of [Setting a proxy for Chrome Driver in Selenium](http://stackoverflow.com/questions/27730306/setting-a-proxy-for-chrome-driver-in-selenium) – JRodDynamite Nov 11 '16 at 16:55
  • Do you need only the webdriver's session to be with that proxy or do you need to authenticate against that server once before the tests? – Moshisho Nov 12 '16 at 18:13
  • I need to authenticate against the server once before the tests. My development environment does not have direct access to the Internet so I must go through an authenticated proxy (out of my control unfortunately) – Braydie Nov 13 '16 at 11:20

0 Answers0