...timed out after 60 seconds
 
So here's the thing: we have functional tests that use Selenium and they have mostly been working fine for many months with the occasional random failure. In the last week, as sod's law would have it, I updated loads of projects to start referencing netstandard dlls and also migrated some web sites to web applications in .Net.

Push the code and as expected, various tests were failing. I had to look into these. Some were the tests that often failed for reasons unknown so I introduced some more delays and WaitForDisplayed and what have you, but it wasn't helping, tests were randomnly failing.

Then loads of other projects starting failing too and most of these had some kind of timeout exception either the one in the title or a similar one caused when we were waiting for something to load.

Much headscratching and fault-finding ensued including scratching our heads as to why it worked when we ran them locally but failed on the build server. They also worked fine when run on the build server via RDP in NUnit GUI.

Well the problem was that ChromeDriver.exe was sandboxing the tests by default. This meant that calls to non-sandbox friendly methods like Window.Maximize() were failing. They failed, however, by not receiving a response and therefore eventually timing out - why they didn't return friendly errors I do not know. I also do not know why the failures were random instead of consistent in the past.

I don't know, but I do know this, we had to tell Chrome not to sandbox the tests using code like the following in VB.net:

Dim options = New ChromeOptions
options.AddArgument("no-sandbox")
Driver = New ChromeDriver(driversPath, options, TimeSpan.FromMinutes(1))

or C#

var options = new ChromeOptions();
options.AddArgument("no-sandbox");
WebDriver = new ChromeDriver(driversPath, options, TimeSpan.FromMinutes(1));