FuckTheWorld / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Get a "WebDriverException: disconnected: unable to receive message from renderer" error when switching browser windows #401

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
It's an internal application where I am testing the following scenario:
1. Once a file is uploaded successfully, the GUI page opens a new window (to 
display file information).
2. I switch on the new window--->click on OK to close this window.
3. Switch back to the previous parent window.
4. Before I can switch back to parent window, both the browser windows close 
(where only the new one should, after "OK" is clicked).

The exception that I get is:

org.openqa.selenium.WebDriverException: disconnected: unable to receive message 
from renderer
  (Session info: chrome=27.0.1453.116)
  (Driver info: chromedriver=0.7,platform=Windows NT 5.1 SP2 x86) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 125 milliseconds
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', 
java.version: '1.7.0_17'
Session ID: 1fc5d8379d21099628679450b0b185e9
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, 
browserName=chrome, rotatable=false, driverVersion=0.7, 
locationContextEnabled=true, version=27.0.1453.116, cssSelectorsEnabled=true, 
databaseEnabled=true, handlesAlerts=true, browserConnectionEnabled=false, 
webStorageEnabled=true, nativeEvents=true, applicationCacheEnabled=false, 
takesScreenshot=true}]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
    at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:268)
    at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:79)
    at com.axway.webliv.utilities.tools.Tools$2.apply(Tools.java:201)
    at com.axway.webliv.utilities.tools.Tools$2.apply(Tools.java:1)
    at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:208)

What version of the product are you using? On what operating system?
ChromeDriver = 0.7
Chrome = 27.0.1453.116
OS = Windows XP

Please attach chromedriver.log to your bug report if possible.

Original issue reported on code.google.com by natasha...@gmail.com on 24 Jun 2013 at 11:41

Attachments:

GoogleCodeExporter commented 9 years ago
Would you please try with the stable release chromedriver2.0?

If the problem still exists, would you please provide a test script against a 
simplified HTML test page or a public website and the chromedriver.log?

Original comment by st...@chromium.org on 27 Jun 2013 at 5:05

GoogleCodeExporter commented 9 years ago

Original comment by kkania@chromium.org on 3 Jul 2013 at 9:27

GoogleCodeExporter commented 9 years ago
I am able to reproduce this issue with ChromeDriver 2.2

Steps to reproduce:
1. Open a popup
2. Trigger any event from the popup window that automatically close himself 
(window.close())
3. Switch to parent window
4. Interact with any element from the parent window

ChromeDriver 2.2
Chrome 29.0.1547.57
Windows 7 SP1

Original comment by juanpar...@gmail.com on 25 Aug 2013 at 11:18

GoogleCodeExporter commented 9 years ago
Sometimes the following error is raised: disconnected: DevTools client closed 
during closing UI debuggers

Original comment by juanpar...@gmail.com on 25 Aug 2013 at 11:48

GoogleCodeExporter commented 9 years ago
Here is some code which reliably reproduces this issue:

package ..;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class TestWindowClose {

    @Test
    public void test() throws Exception {

        WebDriver d = new ChromeDriver();

                // Page with a button that opens a window which immediately closes
        d.get("http://jsfiddle.net/Nx9Js/show/");
        String winHandleBefore = d.getWindowHandle();

        d.findElement(By.tagName("input")).click();

        //Switch to new window opened
        for(String winHandle : d.getWindowHandles()){
            if (!winHandle.equals(winHandleBefore))
                d.switchTo().window(winHandle);
        }

        // Fails
        System.out.println(d.getTitle());
    }
}

Each time you run it you get a different failure...  Including:

- org.openqa.selenium.WebDriverException: disconnected: DevTools client closed 
during closing UI debuggers
- org.openqa.selenium.WebDriverException: disconnected: unable to receive 
message from renderer
- org.openqa.selenium.NoSuchWindowException: no such window

The last one is legitimate if a race condition occurs closing the window after 
you get the handle but before the switch.  Once in a while if the race goes the 
other way it passes.

org.openqa.selenium.WebDriverException: disconnected: DevTools client closed 
during closing UI debuggers
  (Session info: chrome=30.0.1599.14)
  (Driver info: chromedriver=2.2,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 36 milliseconds
Build info: version: '2.35.0', revision: '8df0c6b', time: '2013-08-12 15:43:19'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', 
java.version: '1.6.0_43'
Session ID: 3631c4c05fbd67044b35354a69e3bce9
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, 
browserName=chrome, chrome={chromedriverVersion=2.2}, rotatable=false, 
locationContextEnabled=true, version=30.0.1599.14, cssSelectorsEnabled=true, 
databaseEnabled=true, handlesAlerts=true, browserConnectionEnabled=false, 
nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, 
takesScreenshot=true}]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:191)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:569)
    at org.openqa.selenium.remote.RemoteWebDriver.getTitle(RemoteWebDriver.java:285)
...

org.openqa.selenium.WebDriverException: disconnected: unable to receive message 
from renderer
  (Session info: chrome=30.0.1599.14)
  (Driver info: chromedriver=2.2,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 515 milliseconds
Build info: version: '2.35.0', revision: '8df0c6b', time: '2013-08-12 15:43:19'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', 
java.version: '1.6.0_43'
Session ID: 51e61c0526a3db0776905effb8de653c
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, 
browserName=chrome, chrome={chromedriverVersion=2.2}, rotatable=false, 
locationContextEnabled=true, version=30.0.1599.14, cssSelectorsEnabled=true, 
databaseEnabled=true, handlesAlerts=true, browserConnectionEnabled=false, 
nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, 
takesScreenshot=true}]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:191)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:569)
    at org.openqa.selenium.remote.RemoteWebDriver.getTitle(RemoteWebDriver.java:285)
...

org.openqa.selenium.NoSuchWindowException: no such window
  (Session info: chrome=30.0.1599.14)
  (Driver info: chromedriver=2.2,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 28 milliseconds
Build info: version: '2.35.0', revision: '8df0c6b', time: '2013-08-12 15:43:19'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', 
java.version: '1.6.0_43'
Session ID: cb3478b91957440f96d32a7ae26978fd
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, 
browserName=chrome, chrome={chromedriverVersion=2.2}, rotatable=false, 
locationContextEnabled=true, version=30.0.1599.14, cssSelectorsEnabled=true, 
databaseEnabled=true, handlesAlerts=true, browserConnectionEnabled=false, 
nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, 
takesScreenshot=true}]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:191)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
    at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.window(RemoteWebDriver.java:831)
...

Original comment by edw...@gmail.com on 28 Aug 2013 at 7:08

GoogleCodeExporter commented 9 years ago
Experience same issue. Easily happens when clicking  a button to close a popup 
window, especially on windows machine.

Original comment by lucyyan...@gmail.com on 28 Aug 2013 at 7:23

GoogleCodeExporter commented 9 years ago
Same issue here, usually either when switching between a popup window and its 
parent window or vice versa, or trying to close a popup window. Chrome 29, 
Chromedriver 2.2, Windows 7 SP1.

Selenium::WebDriver::Error::WebDriverError:
  disconnected: unable to receive message from renderer
    (Session info: chrome=29.0.1547.66)
    (Driver info: chromedriver=2.2,platform=Windows NT 6.1 SP1 x86_64)

Original comment by xaen...@gmail.com on 6 Sep 2013 at 2:18

GoogleCodeExporter commented 9 years ago
Hello,

This issue is also present on Webdriver 2.3 Full exception information is in 
the attached file.

The issue occurs when I am trying to click on a WebElement after changing to 
another Chrome Window. It does not occur all the time, but still this issue 
breaks the tests.

Original comment by Kasja...@gmail.com on 16 Sep 2013 at 2:01

Attachments:

GoogleCodeExporter commented 9 years ago
I and many others are also seeing this.  Would be great if this Priority could 
be raised from a 3 and fixed soon since this causes lots of failures where 
there shouldn't be any.

Original comment by phas...@gmail.com on 16 Sep 2013 at 9:40

GoogleCodeExporter commented 9 years ago

Original comment by st...@chromium.org on 26 Sep 2013 at 10:07

GoogleCodeExporter commented 9 years ago
We are experiencing same issue. Especially when clicking a button which closes 
a popup window. We are use ChromeDriver 2.3 and Chrome browser Version 
29.0.1547.76 m.

Original comment by lucyyan...@gmail.com on 29 Sep 2013 at 3:31

GoogleCodeExporter commented 9 years ago
I found a workaround for this.  This was only occurring (for me at least) when 
a second web page opened (a web-dialog) and a link action was clicked that then 
closed that dialog.  If I catch the WebDriverException and ignore it, then 
everything runs without a problem.

Original comment by david.ge...@gmail.com on 15 Oct 2013 at 11:19

GoogleCodeExporter commented 9 years ago
Note that this issue no longer explicitly disconnects the driver any longer.  
However I am seeing similar issues which are causing chromedriver to hang for 
600 seconds while trying to retrieve an alert on a closed window.

Original comment by edw...@gmail.com on 2 Dec 2013 at 9:06

GoogleCodeExporter commented 9 years ago
Is there any work going on regarding this issue? We're experiencing the same 
problem with Chrome 37.0.2062.103 m and ChromeDriver 2.10

The problem occurs if we press a link which reloads the page and the result 
contains a window.close() action. Afterwards any communication with chrome 
driver fails.

Original comment by dominik....@gmail.com on 4 Sep 2014 at 10:20

GoogleCodeExporter commented 9 years ago
Even I am facing this issue. Below is the error what I got and the logs which 
was reported while clicking a link in Iframe. I tried upgrading the drivers 
aswell as the browser. 

Error : 
Result Message: Assert.Fail failed. disconnected: Unable to receive message 
from renderer
  (Session info: chrome=37.0.2062.120)
  (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.1 SP1 x86_64) (102)

Log:
[206.125][INFO]: COMMAND ClickElement {
   "id": "0.7071966589428484-5"
}
[206.126][INFO]: Waiting for pending navigations...
[206.126][INFO]: Done waiting for pending navigations
[206.300][INFO]: Waiting for pending navigations...

Original comment by ba.raghu@gmail.com on 22 Sep 2014 at 9:39

GoogleCodeExporter commented 9 years ago
I have been facing the same issue

Original comment by btjakach...@gmail.com on 3 Oct 2014 at 8:20

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:18

GoogleCodeExporter commented 9 years ago
Unable to reproduce issue with chromedriver:2.15, chrome:v42

Please try with latest versions and let us know if we differ from what you are 
trying.

Sample code:
System.setProperty("webdriver.chrome.driver",Utility.getPath("drivers/chromedriv
er.exe"));

                WebDriver driver = new ChromeDriver();

                driver.manage().timeouts().implicitlyWait(1, TimeUnit.MINUTES);
                driver.get("http://jsfiddle.net/Nx9Js/show");
                String winHandleBefore = driver.getWindowHandle();
                driver.switchTo().frame(0);
                driver.findElement(By.tagName("input")).click();

                for (String winHandle : driver.getWindowHandles()) {
                        if (!winHandle.equals(winHandleBefore))
                                driver.switchTo().window(winHandle);
                }

                System.out.println("new Window title:"+driver.getTitle());
                //driver.switchTo().window(winHandleBefore);
                //System.out.println("old Window title:"+driver.getTitle());

                driver.quit();

Original comment by ssudunag...@chromium.org on 24 Apr 2015 at 11:47

GoogleCodeExporter commented 9 years ago
natasha999

please try with latest versions of chromedriver:2.15 and chrome:v43 and let us 
know if you still see the issue.

Original comment by ssudunag...@chromium.org on 25 May 2015 at 11:19

GoogleCodeExporter commented 9 years ago
natasha999@

is this issue still reproducible for you in latest version of ChromeDriver 2.16 
?
as mentioned in comment#18 tried locally and unable to reproduce the issue and 
driver.getWindowHandle/s() works fine.

please let us know based on that we can close this issue.

Thanks

Original comment by agau...@chromium.org on 26 Jun 2015 at 12:32

Nandhis commented 5 years ago

In Stackoverflow someone mentioned below code will resolve this issue.. I never tested for myself.

System.setProperty("webdriver.chrome.driver","E:\selenium\chromedriver_2.41\chromedriver.exe"); ChromeOptions options = new ChromeOptions(); options.setPageLoadStrategy(PageLoadStrategy.NONE); driver = new ChromeDriver(options);