2
  • C# .NET Framework 4.8 Console Application(32bit)
  • Edge(Chromium) 80.0.361.69
  • msedgedriver.exe(64bit, 80.0.316.69)
  • Windows 10 Home 64bit 1909 18363.720
  • Selenium.WebDriver 4.0.0-alpha05
static void Main()
{

    var edgeOptions = new EdgeOptions
    {
        UseChromium = true,
        BrowserVersion = "80.0.361.69",
        BinaryLocation = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
    };

    var service = EdgeDriverService.CreateDefaultServiceFromOptions(Directory.GetCurrentDirectory(), "msedgedriver.exe", edgeOptions);
    using IWebDriver driver = new EdgeDriver(service, edgeOptions)
    {
        Url = "https://www.naver.com"
    };
    Console.ReadLine();
    //While the program is paused, I opened a new window manually and pressed enter on the console

    driver.SwitchTo().Window(driver.WindowHandles[1]); // this takes 30ms
    //After calling driver.SwitchTo().Window(), 
    //a message [1585376776.256][WARNING]: Timed out connecting to Chrome, retrying... appears on the console.

    var elements = driver.FindElements(By.Id("whatever")); //this takes 4030ms

}

Above are My environments and the code
When I run my program,

Starting MSEdgeDriver 80.0.361.69 (11b2f9c770113c9712ab7dffaca9ea3596d0deb3) on port 13626
Only local connections are allowed.
Please protect ports used by MSEdgeDriver and related test frameworks to prevent access by malicious code.

DevTools listening on ws://127.0.0.1:13630/devtools/browser/6820c242-c3b6-43c1-9e19-98742a95cc18
[1585376743.252][WARNING]: Timed out connecting to Chrome, retrying...
[1585376745.407][SEVERE]: Timed out receiving message from renderer: 0.100
[1585376745.509][SEVERE]: Timed out receiving message from renderer: 0.100
[1585376745.610][SEVERE]: Timed out receiving message from renderer: 0.100
[1585376745.711][SEVERE]: Timed out receiving message from renderer: 0.100
[1585376745.873][SEVERE]: Timed out receiving message from renderer: 0.100
[1585376745.974][SEVERE]: Timed out receiving message from renderer: 0.100
[1585376746.075][SEVERE]: Timed out receiving message from renderer: 0.100
[1585376746.179][SEVERE]: Timed out receiving message from renderer: 0.100
[1585376746.659][SEVERE]: Timed out receiving message from renderer: 0.100
[1585376746.800][SEVERE]: Timed out receiving message from renderer: 0.100
[1585376746.961][SEVERE]: Timed out receiving message from renderer: 0.100
[1585376747.187][SEVERE]: Timed out receiving message from renderer: 0.100
[1585376747.521][SEVERE]: Timed out receiving message from renderer: 0.100

this messages come up on the console.
It's negligible if I don't switch to another window but whenever switching to another window,

[1585376776.256][WARNING]: Timed out connecting to Chrome, retrying... 

appears on the console. this appears again and the next first driver.FindElements() call always takes around 4 seconds.
I tested this issue with chrome but the result was the same.
I've googled a lot but I couldn't find any appropriate answer.
How can I resolve this issue?

Rhythm
  • 21
  • 1
  • 2
  • Not sure why you are not using driver.Navigate().GoToUrl(). You said that you are opening the window manually and you are using driver.SwitchTo().Window(driver.WindowHandles[1]); to switch to that window. I suggest you check whether your code referring to the correct window or not. As the window was opened manually, I am not sure whether selenium driver can detect an switch to it. For testing purposes, try to open the window using code and check whether code able to switch to it to not. Also, try to count the total windows and try to loop through it to know which windows are opened. – Deepak-MSFT Mar 30 '20 at 02:23
  • The reason why I opened the window manually is because captcha detects selenium and shows up. I only got two windows and tested a lot so it's certain that my code aren't wrong. And I summed up the code in order to give an simple example. The original code is, selenium navigates to a sign in url and wait until I manually sign in, solving captcha. Then selenium clicks a button, creating a new popup window, switching to it and so on. – Rhythm Mar 30 '20 at 03:09
  • I now understand what you are trying, I want to confirm with you that does your code able to find that window? – Deepak-MSFT Mar 30 '20 at 06:19
  • Yes. I want to know why it takes a while and the connecting warning appears – Rhythm Mar 30 '20 at 07:34

1 Answers1

0

Whenever you are loading some page with the help of selenium driver, then driver script wait till page is completely loaded. But sometime webdriver takes 3 to 4 mins to load page, in that case you will see TimeoutException exception in your console.

When Page Loading takes too much time and you need to stop downloading additional subresources (images, css, js etc) you can change the pageLoadStrategy through the webdriver.

By default, when Selenium loads a page, it follows the normal pageLoadStrategy.

System.setProperty("webdriver.edge.driver","E:\\edgedriver.exe");

edgeOptions options = new EdgeOptions();
options.setPageLoadStrategy(PageLoadStrategy.NONE);

driver = new EdgeDriver(options);

Reference:

Timed out receiving message from renderer in selenium

Deepak-MSFT
  • 10,379
  • 1
  • 12
  • 19
  • Hmm... I tried your solution, nothing changed. In my case the timed out warning appears even before I see the page content regardless of the 3 mins you mentioned. I also checked if there was anything left to be loaded on the network tab using the developer tool. Whenever selenium switchs to a new window that is completely loaded the next method call takes 4 seconds. – Rhythm Mar 30 '20 at 11:14
  • I tried to refer to this thread and as per discussion, it looks like there is some issue in the web driver. They are discussing Chrome web driver but I think there is a similar issue in Edge web driver. They said if you upgrade or downgrade the web driver then the issue can be solved. If possible you can have a try with a different version of web driver. Ref: https://stackoverflow.com/questions/60114639/timed-out-receiving-message-from-renderer-0-100-log-messages-using-chromedriver web driver links: https://msedgewebdriverstorage.z22.web.core.windows.net/ – Deepak-MSFT Mar 31 '20 at 05:24
  • I just tried with the version 81.0.416.41. the printed text is [15892:848:0331/150726.512:ERROR:browser_switcher_service.cc(238)] XXX Init() [1585634850.609][SEVERE]: Timed out receiving message from renderer: 0.100 [1585634850.730][SEVERE]: Timed out receiving message from renderer: 0.100 [15892:848:0331/150731.208:ERROR:device_event_log_impl.cc(162)] [15:07:31.207] Bluetooth: bluetooth_adapter_winrt.cc:1055 Getting Default Adapter failed. The time was reduced to 2 secs but it still takes long enough. – Rhythm Mar 31 '20 at 06:14
  • I will try to discuss this issue with other engineers to know their opinion on this issue and if I get any useful information then I will try to provide you. Thanks for your understanding. – Deepak-MSFT Apr 01 '20 at 09:33