I am getting the following error when executing my tests on LambdaTest with mobile devices: “C# HTTP connection timed out after 60 seconds” How to fix this?
Hi Dipen,
There might be cases where you face the following exception (especially in the case of simulators/emulators): C# HTTP connection timed out after 60 seconds
. This is because the default connection timeout for the C# language is for 60 seconds.
However, this can be avoided by increasing the connection timeout by adding the Timespan
parameter to the RemoteWebDriver initialization command:
For example, when using Desired Capabilities Object:
driver = new RemoteWebDriver(new Url(Hub URL), capabilities, TimeSpan.FromSeconds(600));
To be more precise:
driver = new RemoteWebDriver(new Url("https://" + username + ":" + accesskey + gridURL),
options.ToCapabilities(), TimeSpan.FromSeconds(600));