rshf / chromedriver

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

:takeHeapSnapshot fails with "A exception with a null response was thrown sending an HTTP response..." after upgrading to Chrome 34 #756

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Issue Description:
I'm trying to use the ":takeHeapSnapshot" call (as shown in Issue 519) but it 
started failing after upgrading to Chrome 34.0.1847.116 m.  It worked fine when 
using Chrome 33.  The exception I get is:
OpenQA.Selenium.WebDriverException: A exception with a null response was thrown 
sending an HTTP request to the remote WebDriver server for URL 
http://localhost:16041/session/2e48a99b94564f351a3ae4aa5c6e9297/execute. The 
status of the exception was ReceiveFailure, and the message was: The underlying 
connection was closed: An unexpected error occurred on a receive. ---> 
System.Net.WebException: The underlying connection was closed: An unexpected 
error occurred on a receive. ---> System.IO.IOException: Unable to read data 
from the transport connection: An existing connection was forcibly closed by 
the remote host. ---> System.Net.Sockets.SocketException: An existing 
connection was forcibly closed by the remote host
Result StackTrace:  
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, 
SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
 --- End of inner exception stack trace ---
    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
 --- End of inner exception stack trace ---
    at System.Net.HttpWebRequest.GetResponse()
   at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
 --- End of inner exception stack trace ---
    at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScriptCommand(String script, String commandName, Object[] args)
   at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScript(String script, Object[] args)

Steps to reproduce:
Run the following code (C#)
webDriver.Navigate().GoToUrl("http://www.example.com");
            var snapshot = (webDriver as IJavaScriptExecutor).ExecuteScript(":takeHeapSnapshot") as Dictionary<string, object>;

Setup:
Windows 8
Chromedriver 2.9
WebDriver 2.41
Chrome 34.0.1847.116 m

Original issue reported on code.google.com by RPW...@gmail.com on 10 Apr 2014 at 2:10

Attachments:

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.14, chrome:v41 Windows 7 / Ubuntu

Sample Code:
System.setProperty("webdriver.chrome.driver",
"drivers/chromedriver");

WebDriver driver = new ChromeDriver();
driver.navigate().to("http://www.google.com");
Map<Object, Object> temp =(Map<Object, Object>) 
((JavascriptExecutor)driver).executeScript(":takeHeapSnapshot");

PrintWriter pw = new PrintWriter("output/chromeheapsnapshot.txt");
for(Object obj:temp.keySet()){
pw.write(obj.toString()+"\t"+temp.get(obj));
}
pw.flush();
pw.close();
System.out.println("completed");

Original comment by ssudunag...@chromium.org on 27 Mar 2015 at 5:07

betimer commented 8 years ago

I have faced the similar issue:

Test method Testing.EndToEnd.MsTest.SWRCanClickFromDashboardCountsToSWR.TheSWRCanClickFromDashboardCountsToSWRTest threw exception: OpenQA.Selenium.WebDriverException: A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://localhost:50530/session/25b322b6e78bd4824810e3e7ebc895a9/element/0.9115849656278625-2/css/background-color. The status of the exception was ConnectFailure, and the message was: Unable to connect to the remote server ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:50530