What is RemoteWebDriver

Selenium Error - The HTTP request to the remote WebDriver expired after 60 seconds


I've been using selenium for a few months now, which we use to automate some of our internal testing processes. The scripts passed well. I recently upgraded to the web driver C # 2.40.0 with FF 27.01 and our scripts are now failing in random places with the following error.

The final bug I found on a single line of code:

The annoying thing is that trying to fix the problem turns out to be difficult as if I were running the test on my local computer. If I run it through the NUNIT runner on the build machine I'm running the test on, it also passes. It only seems to fail as part of our automated build execution process when using Teamcity. Like I said this has been going fine for months and the only thing that has changed is the selenium webdriver kit.

I've already encountered this problem while debugging, and when a line of code was called, Firefox appeared to be blocking and just stopping the test would allow Firefox to continue. There are a number of suggestions here including changing the webdriver source? If possible, I don't want to go this route if someone else can make suggestions.


Reply:


I had a similar problem with the Chrome driver (v2.23) / running the tests through TeamCity. I was able to fix the problem by adding the no sandbox flag to Chrome options:

I'm not sure there is a similar option for the FF driver. As far as I know, the problem has something to do with TeamCity which Selenium is running under the SYSTEM account.





Start your browser with the lines of code above. It worked for me.



I first encountered this problem (also on command) months ago, and it has been a problem for me ever since. There appears to be a problem with the .NET Selenium bindings. This blog post from the man who works on the IE driver is helpful in explaining what is happening:

http://jimevansmusic.blogspot.com/2012/11/net-bindings-whaddaymean-no-response.html

Unfortunately, there doesn't seem to be a real solution to this problem. Whenever this problem has been raised with the Selenium developers (see here), this is a typical answer:

We need a reproducible scenario that must contain a sample page or a link to a page on a public site where the problem can be reproduced.

Being able to submit a consistently reproducible test case can be very helpful in fixing this bug for good.

Perhaps in the meantime, you can try this workaround. If the HTML button you want to use has an attribute that contains Javascript, consider using a JavascriptExecutor to run that code directly instead of invoking the command. I've found that running Javascript directly can pass some of my tests.


Had the same problem with Firefox. I switched to Chrome with options and everything has been fine ever since.



In my case, the type of my button is not and I am changing that every work well up until then. Something like below

of

to

BTW, I've tried all of the answers in this post but they don't work for me.


Have a similar problem. Try to set more time in the driver's constructor - add e.g.





I think this problem occurs when you try to access your web driver object afterward

1) A window has been closed and you have not yet switched to the higher-level window

2) You switched to a window that wasn't ready and has been updated since you switched

Waiting for what you expect does not take into account the content of the page or document.ready. I'm still looking for a solution to this problem


In my case, it's because I deleted the Chrome update folder. After reinstalling Chrome, it works fine.


The problem is, when evaluating timeouts in your build environment, you may want to investigate what matters.

Also try to add retries for, as the evaluations sometimes take longer, depending on the network speed, etc.



In my case, I noticed that this error was occurring in our team build server. The tests were carried out on our local development machines.

The problem was that the target website was not configured correctly on the build server and therefore the browser could not open properly.

We used the Chrome driver, but I'm not sure that makes any difference.


In my case, the problem was with SendKeys () and Remote Desktop. Posting the workaround I've had so far:

I had a Selenium test that failed when run as part of a Jenkins job on a node hosted in vSphere and managed via RDP. After some troubleshooting it turned out to be successful when Remote Desktop is connected and focused, but fails with the exception when Remote Desktop is disconnected or even minimized.

As a workaround, I signed in through the vSphere Console instead of RDP, and even after closing vSphere, the test did not fail. This is a workaround, but I would have to be careful never to log in through RDP and only ever manage through the vSphere Console.


Changing the Selenium.WebDriver.ChromeDriver from 2.40.0 to 2.27.0 is fine with me


That was out of date.

You can now use it instead.

There is one too and it works. However, it is not documented and you will have to specify it manually even though it already exists.


We had the same problem. In our case, the browser was blocked by a login popup (Windows authentication) and did not return after 60 seconds. Adding proper permissions to the Windows account under which Chrome was running solved the problem.


Arrrgh! This was under today macOS the case and the problem was as simple as: the popup window asking for the installation of the new Appium Version was proposed, has been made on the remote CI Buildserver displayed .

Just VNC'ing to it and click on " Install later "fixed it.


In my case, none of the above answers completely solved my problem. I ended up using () mode, extended timeout period connection (), and page loading timeout (). Now my code looks like this:

But as I mentioned, none of the above methods solved my problem, I kept getting the error and several processes of chromedriver.exe and chrome.exe were active (~ 10 of the chromedriver and ~ 50 of the chrome).

I read somewhere that after disposing of the driver, I should wait a few seconds before starting the next test. So I added the following line to dispose of the method:

With this sleep change, I no longer have a timeout error and there are no unnecessarily opened processes chromedriver.exe and chrome.exe.

I hope I have helped someone who has struggled with this problem for as long as I have.


I had the same exception when trying to run a headless ChromeDriver with a scheduled task on a Windows server (unattended). What it solved for me is the task as User " Administrators " to execute (note the S at the end). Also, what I did (don't know if it's relevant) is the Any Connection option on the Conditions tab.


For ChromeDriver, the following worked for me:

Selenium Version 3.11, ChromeDriver 2.37

We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By continuing, you consent to our use of cookies and other tracking technologies and affirm you're at least 16 years old or have consent from a parent or guardian.

You can read details in our Cookie policy and Privacy policy.