Cannot get automation extension from timeout: Timed out receiving message from renderer
Asked Answered
T

7

15

Using Selenium Webdriver (C#) I'm getting the next error from time to time:

System.InvalidOperationException : unknown error: cannot get automation extension from timeout: Timed out receiving message from renderer: -3.959 (Session info: chrome=37.0.2062.120) (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.2 x86_64)

The way in which this mistake appears:

OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 1048 at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 865 at AutomatedTests.DriverCover..ctor(IWebDriver driver)

So, it's happening in the next piece of code:

 public class DriverCover
 {
        public DriverCover(IWebDriver driver)
        {
            _driver = driver;

            _driver.Manage().Window.Maximize(); //There is my mistake
        }

        private readonly IWebDriver _driver;
 }

I use this class as a base class of PageObject classes where I use PageFactory to initialize elements of web pages.

I have chromedriver v.2.10 and Google Chrome v. 37.0.2062.120 m

In addition: at the same line I got another error:

OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:62407/session/021e05cd4c89abedb2abc77342b3bd7c/window/current/maximize timed out after 60 seconds. ----> System.Net.WebException : The operation has timed outat OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\HttpCommandExecutor.cs:line 152 at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\DriverServiceCommandExecutor.cs:line 73 at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\webdriver\dotnet\src\webdriver\Remote\RemoteWebDriver.cs:line 852 at AutomatedTests.DriverCover..ctor(IWebDriver driver)

Touchstone answered 17/9, 2014 at 12:0 Comment(5)
version of selenium is 2.42.0Touchstone
I got this error as soon as I upgraded to windows 10Sayette
I had to brew update && brew upgrade chromedriver and I was good to go with Chrome v57.Laticialaticiferous
@DenisKoreyba Any chance you can mark one as the answer if it solved your issue?Thrombophlebitis
@Thrombophlebitis this error occurs due to different reasons. I haven't encountered it for a long time. But I don't think any of the suggested methods is solving it once and for all.Touchstone
T
19

We were seeing something similar with Chrome and the issue came down to the way we were maximizing the browser before running the tests.

We switched from this:

Driver.Manage().Window.Maximize();

To this (for Chrome only):

if (typeof(TWebDriver) == typeof(ChromeDriver))
{
    var options = new ChromeOptions();
    options.AddArgument("start-maximized");

    driver = new ChromeDriver(driverPath, options);
}
Thrombophlebitis answered 9/10, 2014 at 16:48 Comment(3)
YAY!! fixes Teamcity build: Test(s) failed. TinyIoC.TinyIoCResolutionException : Unable to resolve type: OpenQA.Selenium.IWebDriver ----> OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL localhost:xxxxxx/session timed out after 60 seconds.Hazy
@Hazy it seems you have issues connecting to new Chrome v52 and new chromedriver v.23. They don't work with teamcity :(Touchstone
@DenisKoreyba Well, actually mine now does (with new Chrome v52 and new chromedriver v.23) already had 4 consecutive successful builds on TeamCity, since I changed the maximized setting to be passed as a switch. Maybe there something else that changed, although that's all I changed...Hazy
S
4

It happens because of Chrome Driver Mismatch.I had fixed this issue by upgrading my driver to the latest version.i.e 2.29(https://chromedriver.storage.googleapis.com/index.html?path=2.29/)

Steamer answered 10/4, 2017 at 9:51 Comment(0)
S
1

You can try this, worked for me My chrome browser version is : 57 and Chrome Driver version is : 2.27 By adding the following code lines i resolved my problem.

ChromeOptions options = new ChromeOptions();
options.addArguments("enable-automation");
options.addArguments("--disable-infobars");
WebDriver driver = new ChromeDriver(options);
Saran answered 8/5, 2017 at 5:6 Comment(3)
Where did you add this code?. In which file, I have add this? conf.js?Doubletongue
@JeevaJsb search for "new ChromeDriver" in your project, we don't know what files you have on your systemBersagliere
This is doesn't help for me. I have done this with Firefox. That works better.Doubletongue
D
1

THIS WORKS After googling through many many threads, I finally got the solution to such problems.

While most of the solutions above have pointed out the problem correctly which is arising due to bug in Chrome updates, follow below solution to get it fixed-

Download and use the latest ChromeDriver- compatible with the version of Chrome Download the latest Selenium Driver from https://www.selenium.dev/ and execute the jar file on your system once. Run the you code again to see the magic

Dupre answered 7/6, 2021 at 8:22 Comment(0)
H
0

Had a similar issue, same error, but when calling getScreenshotAs().... I had a old ChromeDriver and updating fixed the issue for me

Halvorsen answered 26/4, 2017 at 17:41 Comment(0)
D
0

I had the same problem during jenkins job run. The fix which was working for me is to setup proxies in .bash_profile under jenkins user:

sudo su -s /bin/bash jenkins
nano ~/.bash_profile
...your proxy
source ~/.bash_profile
Dunkle answered 3/6, 2022 at 18:30 Comment(0)
D
-1

Updating the ChromeDriver will do the trick for this problem.

Discompose answered 27/2, 2017 at 10:14 Comment(2)
Please consider adding more information to explain your answer. Code-only comments are not always explicit.Pokey
Thank you for sharing the feedback.This issue basically happens when we try to maximize a chrome browser in MAC OSDiscompose

© 2022 - 2024 — McMap. All rights reserved.