dotnet-client
dotnet-client copied to clipboard
Mobile Tests Behind a Proxy
Description
We are trying to run some automated tests for our Xamarin based iOS app using the IOSDriver within Visual Studio for Mac.
The error we are getting when we run them is (I've sanitised to remove the URL we are actually trying to send the request to).
A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL https://<Test Host URL>. The status of the exception was NameResolutionFailure, and the message was: nodename nor servname provided, or not known nodename nor servname provided, or not known
Because our machines are behind a proxy we often see DNS errors like this when the code sending the request is unaware of the proxy.
We've tried various approached to setting the proxy, such as HttpClient.DefaultProxy and OpenQA.Selenium.Proxy but the error still persists.
Are there any other ways to tell the tests that they are operating behind a proxy?
Environment
- .NET client build version or git revision if you use some shapshot: 4.2.1
- Appium server version or git revision if you use some shapshot:
- Desktop OS/version used to run Appium if necessary: OS X 11.6
- Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe:
- Mobile platform/version under test: iOS
- Real device or emulator/simulator: Simulator
HttpCommandExecutor executor = new HttpCommandExecutor(remoteUrl, TimeSpan.FromMinutes(5))
{
Proxy = proxy
};
iOSDriver = new IOSDriver<AppiumWebElement>(executor, driverOptions);
This works for me, remoteUrl is an Appium-Server that is external and only accessible through a corporate proxy.
@benwalpole does the solution provided suites your needs?
Closed as no response