C# Default Connection Timeout and Lambdatest URL Timeout Issue

The default connection timeout for the C# language is for 60 seconds. There may be cases where the user might face the following exception (especially in the case of sim/emulators): Error : The HTTP request to the remote WebDriver server for URL (https://LOGIN:ACCESKEY@hub.lambdatest.com/wd/hub/session) timed out after 60 seconds.

1 Like

Hii Ian,

Adjust the connection timeout in C# to avoid the timeout exception when working with a RemoteWebDriver. The default connection timeout is 60 seconds, which can cause timeouts in some scenarios, especially if you are using a simulator or emulator. To avoid this, increase the connection timeout when the RemoteWebDriver is initialized. To do this, change the code snippet to:

// Example using Desired Capabilities Object
driver = new RemoteWebDriver(new Uri("https://LOGIN:ACCESKEY@hub.lambdatest.com/wd/hub/session"), capabilities, TimeSpan.FromSeconds(600));

In the above example, the ConnectionTimeSpan(600) is set to 600 (10 minutes), which is more flexible and allows the WebDriver to make the connection without timeouts. This will improve the reliability of your C# code, especially when dealing with scenarios where the RemoteWebDriver may need more time to connect to the URL.

Thanks for your inquiry! Your engagement means a lot to us, and we’re ready to address any concerns or queries you may have.

Happy Testing!!! :blush::heart: