Issue 5014 in selenium: FirefoxDriver: Error communicating with the remote browser. It may have died

72 views
Skip to first unread message

sele...@googlecode.com

unread,
Jan 15, 2013, 5:26:43 AM1/15/13
to selenium-develope...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium Status-Untriaged

New issue 5014 by miriam....@gmail.com: FirefoxDriver: Error communicating
with the remote browser. It may have died
http://code.google.com/p/selenium/issues/detail?id=5014

Hi,

A similar issue was reported previously as having occurred in Chrome
(http://code.google.com/p/selenium/issues/detail?id=3000). Comments have
been added to that issue till very recently - about a similar error
occurring in IE and Firefox too.
Since the issue has been in the 'Needs Clarification' state for a long
time, I am opening a new issue for this. Please review and merge with the
previous issue, if needed.

A more recent issue logged for Linux:
http://code.google.com/p/selenium/issues/detail?id=4977

The issue I face is stated below:
I see the following error when using the FirefoxDriver.
Selenium version: 2.28.0
OS: Windows 7
Browser: Firefox
Browser version: 17.0

Error message:
Error communicating with the remote browser. It may have died.
Build info: version: '2.28.0', revision: '18309', time: '2012-12-11
20:21:45'
System info: os.name: 'Windows Server 2008 R2', os.arch: 'amd64',
os.version: '6.1', java.version: '1.7.0_01'

When does the error occur:
The tests are run in parallel and when the tests in a thread are complete,
the quit() method given below is called in order to close the open browsers.
When trying to execute driver.quit(), the error is thrown - at times.

public static void quit() {
try {
if (driver != null) {
driver.quit();
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
driver = null;
}

Temporary workarounds tried:
1. Tried closing the browsers again after catching the exception - but this
does not work all the time.
2. Bypassed the error by enclosing driver.quit() within a try catch and
gobbled up the exception and did nothing about it (bad workaround!)

Previous version:
This used to work fine with Firefox 10 and Selenium 2.20.
No code changes were done from our end when trying to migrate to Firefox 17
using the selenium 2.28 version.

Thanks!

sele...@googlecode.com

unread,
Jan 17, 2013, 3:14:45 PM1/17/13
to selenium-develope...@googlegroups.com
Updates:
Status: NeedsClarification

Comment #1 on issue 5014 by barancev: FirefoxDriver: Error communicating
with the remote browser. It may have died
http://code.google.com/p/selenium/issues/detail?id=5014

Please provide a complete executable sample to reproduce the issue. From
your description it is unclear how do you start drivers, how your static
method (see the code in the original post) that closes (a single?) driver
deals with this concurrency. Unless we reproduce the issue we hardly be
able to fix it. Please help us with a good sample code.

sele...@googlecode.com

unread,
Jan 22, 2013, 12:16:55 PM1/22/13
to selenium-develope...@googlegroups.com

Comment #2 on issue 5014 by benforet...@gmail.com: FirefoxDriver: Error
communicating with the remote browser. It may have died
http://code.google.com/p/selenium/issues/detail?id=5014

Here is code that runs against Selenium 2.29 on Windows 7, in Eclipse:

package example;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;


public class Example {
public static void main(String[] args) throws InterruptedException {

// WebDriver driver = new HtmlUnitDriver();

// causes an exception
WebDriver driver = new FirefoxDriver();

// And now use this to visit Google
driver.get("http://www.google.com");

// Find the text input element by its name
WebElement element = driver.findElement(By.name("q"));

// Enter something to search for
element.sendKeys("Cheese!");

// Now submit the form. WebDriver will find the form for us from
the element
element.submit();


// Check the title of the page
System.out.println("Page title is: " + driver.getTitle());
System.out.println("\nSearch URL: " + driver.getCurrentUrl());
}
}


*****************

A browser starts up, but ...

Exception in thread "main"
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating
with the remote browser. It may have died.
Build info: version: '2.29.0', revision: '58258c3', time: '2013-01-17
22:47:00'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1',
java.version: '1.6.0_31'
Driver info: driver.version: RemoteWebDriver
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:276)
at example.Example.main(Example.java:23)
Caused by: org.apache.http.conn.HttpHostConnectException: Connection to
http://127.0.0.1:7055 refused
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:151)
at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:125)
at
org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at
org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:331)
at
org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:310)
at
org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:133)
at
org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:355)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:506)
... 2 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at
org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:127)
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
... 12 more

et cetera.


******************************

I've gone through several kinds of exceptions, including the "c is null"
one mentioned in item 3537. (The solution mentioned there... is where?)

One source on the Internet suggested changing the number of ephemeral
ports, which I did, and the registry change seems to have worked:

C:\netsh int ipv4 show dynamicportrange tcp

Protocol tcp Dynamic Port Range
---------------------------------
Start Port : 1025
Number of Ports : 35839

But the problem is as shown.

A version of the code works with Internet Explorer, but I can hardly go
forward without being able to run the code in Firefox. Please advise.


sele...@googlecode.com

unread,
Jan 22, 2013, 12:21:17 PM1/22/13
to selenium-develope...@googlegroups.com

Comment #3 on issue 5014 by benforet...@gmail.com: FirefoxDriver: Error
communicating with the remote browser. It may have died
http://code.google.com/p/selenium/issues/detail?id=5014

I am using Firefox ESR version 10.0.12. "Firefox is up to date." An
earlier problem was noted on the web, but the only suggested relief was to
get the most recent version of Firefox:


http://code.google.com/p/selenium/issues/detail?id=3829


sele...@googlecode.com

unread,
Jan 29, 2013, 4:11:01 PM1/29/13
to selenium-develope...@googlegroups.com
Updates:
Labels: Browser-Firefox

Comment #4 on issue 5014 by barancev: FirefoxDriver: Error communicating
with the remote browser. It may have died
http://code.google.com/p/selenium/issues/detail?id=5014

@benforethought: Don't hijack the issue from the author. miriam.dan told
that the exception occurs on quit. Your case looks different -- you get an
exception immediately after start. It's a different issue.

sele...@googlecode.com

unread,
Feb 28, 2013, 7:32:57 PM2/28/13
to selenium-develope...@googlegroups.com
Updates:
Status: Invalid
Labels: -Status-Untriaged

Comment #5 on issue 5014 by barancev: FirefoxDriver: Error communicating
with the remote browser. It may have died
http://code.google.com/p/selenium/issues/detail?id=5014

Closing the issue as there is no information in more than a month

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

sele...@googlecode.com

unread,
Jul 27, 2014, 11:06:43 PM7/27/14
to selenium-develope...@googlegroups.com

Comment #6 on issue 5014 by chaitra....@gmail.com: FirefoxDriver: Error
communicating with the remote browser. It may have died
http://code.google.com/p/selenium/issues/detail?id=5014

[TestNG] Running:

C:\Users\z003c2wt\AppData\Local\Temp\testng-eclipse--1651795367\testng-customsuite.xml

FAILED: setDriverForCiscoSupport
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating
with the remote browser. It may have died.
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16
16:12:12'
System info: host: 'MD1DVJQC', ip: '10.0.0.12', os.name: 'Windows 7',
os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_45'
Driver info: driver.version: RemoteWebDriver
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:276)
at hackerRank.webDriverCiscoSupport.gotoURL(webDriverCiscoSupport.java:21)
at
hackerRank.testNGCiscoSupport.setDriverForCiscoSupport(testNGCiscoSupport.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at
org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117)
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:178)
at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144)
at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:131)
at
org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at
org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at
org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:337)
at
org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:298)
at
org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:165)
at
org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:366)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527)
... 27 more


===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.EmailableReporter2@bf2d5e: 12 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 10 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@18a7efd: 11 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@1632c2d: 7
ms
[TestNG] Time taken by org.testng.reporters.jq.Main@b1c5fa: 25 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@a470b8: 29 ms

sele...@googlecode.com

unread,
Jul 27, 2014, 11:07:54 PM7/27/14
to selenium-develope...@googlegroups.com

Comment #7 on issue 5014 by chaitra....@gmail.com: FirefoxDriver: Error
communicating with the remote browser. It may have died
http://code.google.com/p/selenium/issues/detail?id=5014

[TestNG] Running:

C:\Users\z003c2wt\AppData\Local\Temp\testng-eclipse--1651795367\testng-customsuite.xml


sele...@googlecode.com

unread,
Sep 26, 2014, 9:22:50 AM9/26/14
to selenium-develope...@googlegroups.com

Comment #8 on issue 5014 by hpuma.13...@gmail.com: FirefoxDriver: Error
communicating with the remote browser. It may have died
https://code.google.com/p/selenium/issues/detail?id=5014

log4j:WARN No appenders could be found for logger (Logs).
log4j:WARN Please initialize the log4j system properly.
Started InternetExplorerDriver server (32-bit)
2.43.0.0
Listening on port 34716
Log level is set to TRACE
Log file is set to C:\Automation\Prototype\AssureUser\ieDriver32.log
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.qtpselenium.test.DriverScript.executeKeywords(DriverScript.java:155)
at com.qtpselenium.test.DriverScript.start(DriverScript.java:111)
at com.qtpselenium.test.DriverScript.main(DriverScript.java:67)
Caused by: org.openqa.selenium.remote.UnreachableBrowserException: Error
communicating with the remote browser. It may have died.
Build info: version: '2.43.0', revision: '597b76b', time: '2014-09-09
20:52:38'
System info: host: 'UHIRIYANN-E6440', ip: '172.28.6.37', os.name: 'Windows
7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_33'
Driver info: driver.version: RemoteWebDriver
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:593)
at
org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352)
at
org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:441)
at org.openqa.selenium.By$ByCssSelector.findElement(By.java:426)
at
org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:344)
at com.qtpselenium.test.Keywords.clickLink(Keywords.java:105)
... 7 more
Caused by: org.openqa.selenium.WebDriverException:
org.apache.http.conn.HttpHostConnectException: Connect to localhost:34716
[localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection
refused: connect
Build info: version: '2.43.0', revision: '597b76b', time: '2014-09-09
20:52:38'
System info: host: 'UHIRIYANN-E6440', ip: '172.28.6.37', os.name: 'Windows
7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_33'
Driver info: driver.version: RemoteWebDriver
at
org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:75)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572)
... 12 more
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to
localhost:34716 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed:
Connection refused: connect
at
org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:140)
at
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
at
org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
at
org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
at
org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
at
org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
at
org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at
org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:215)
at
org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:184)
at
org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:66)
... 13 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at
org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:72)
at
org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123)
... 25 more

sele...@googlecode.com

unread,
Jan 23, 2015, 2:12:43 AM1/23/15
to selenium-develope...@googlegroups.com

Comment #9 on issue 5014 by rakeshkm...@gmail.com: FirefoxDriver: Error
communicating with the remote browser. It may have died
https://code.google.com/p/selenium/issues/detail?id=5014

I am also experiencing the same , Any update on the above browser crashed
issue
Reply all
Reply to author
Forward
0 new messages