Issue 1181 in selenium: Firefox driver connection problem

173 views
Skip to first unread message

sele...@googlecode.com

unread,
Jan 11, 2011, 7:16:47 AM1/11/11
to selenium-deve...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1181 by marcin.floryan: Firefox driver connection problem
http://code.google.com/p/selenium/issues/detail?id=1181

Using firefox driver version 2.0b1 in openSuse 11.3 x64 with Mozilla
Firefox 3.6.12

I'm getting the following error trying to use selenium firefox driver to
run functional tests
(grails development but I don't think it's relevant)

System info: os.name: 'Linux', os.arch: 'amd64',
os.version: '2.6.34.7-0.5-desktop', java.version: '1.6.0_22'
Driver info: driver.version: FirefoxDriver
at
org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:108)
at
org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:142)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:80)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:121)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:77)
at
grails.plugin.webdriver.DriverContext.initDriver(DriverContext.groovy:45)
Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to
connect to host 127.0.0.2 on port 7055 after 45000 ms
at
org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:96)

The issue seems related to issue #705
(http://code.google.com/p/selenium/issues/detail?id=705)

Notice how the driver is trying to connect to 127.0.0.2 although firefox is
being launched and is listening on 127.0.0.1 as per the following command:
netstat -atp
tcp 0 0 localhost.localdom:7055 *:*
LISTEN 10965/firefox

and

netstat -atnp
tcp 0 0 127.0.0.1:7055 0.0.0.0:*
LISTEN 10965/firefox

openSuse has the following network configuration:
# Loopback (lo) configuration
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
BROADCAST=127.255.255.255
IPADDR_2=127.0.0.2/8

and the /etc/hosts file is the following

# Syntax:
# IP-Address Full-Qualified-Hostname Short-Hostname

127.0.0.1 localhost.localdomain localhost

# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback

fe00::0 ipv6-localnet

ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
127.0.0.1 mandrax.mm.waw.pl mandrax

If the file looks suspicious because of the last line, I have tried when it
was removed as well with no luck.

<host localhost> returns 127.0.0.1
<dig localhost> returns:
localhost. 655360 IN A 127.0.0.1

Setting -Dsun.net.spi.nameservice.provider.1=dns,sun
-Djava.net.preferIPv4Stack=true makes no difference

Running <java -classpath selenium-java-2.0b1.jar
org.openqa.selenium.networkutils.NetworkUtils> returns

wlan0
address.getHostName() = 192.168.37.21
address.getHostAddress() = 192.168.37.21
address.isLoopbackAddress() = false
lo
address.getHostName() = 127.0.0.2
address.getHostAddress() = 127.0.0.2
address.isLoopbackAddress() = true
address.getHostName() = localhost.localdomain
address.getHostAddress() = 127.0.0.1
address.isLoopbackAddress() = true
Loopback interface LO:
lo
address.getHostName() = 127.0.0.2
address.getHostAddress() = 127.0.0.2
address.isLoopbackAddress() = true
address.getHostName() = localhost.localdomain
address.getHostAddress() = 127.0.0.1
address.isLoopbackAddress() = true

After changing the lo configuration to exclude the alternative IP address
the command returns:

wlan0
address.getHostName() = 192.168.37.21
address.getHostAddress() = 192.168.37.21
address.isLoopbackAddress() = false
lo
address.getHostName() = localhost.localdomain
address.getHostAddress() = 127.0.0.1
address.isLoopbackAddress() = true
Loopback interface LO:
lo
address.getHostName() = localhost.localdomain
address.getHostAddress() = 127.0.0.1
address.isLoopbackAddress() = true

and all works fine. However, I would expect it all to work in the first
case as well.


sele...@googlecode.com

unread,
Jan 20, 2011, 12:40:02 PM1/20/11
to selenium-deve...@googlegroups.com
Updates:
Labels: Browser-Firefox Lang-Java

Comment #1 on issue 1181 by simon.m.stewart: Firefox driver connection
problem
http://code.google.com/p/selenium/issues/detail?id=1181

(No comment was entered for this change.)

sele...@googlecode.com

unread,
Jan 25, 2011, 2:26:02 PM1/25/11
to selenium-deve...@googlegroups.com
Updates:
Status: Started

Comment #2 on issue 1181 by eran....@gmail.com: Firefox driver connection
problem
http://code.google.com/p/selenium/issues/detail?id=1181

I believe I have a fix for the issue - but not having an OpenSuse machine
at hand, I ask the reporter to use the attached jar file for running his
tests and reporting if they work.

Attachments:
client-combined-nodeps.jar 1.7 MB

sele...@googlecode.com

unread,
Jan 26, 2011, 4:19:45 AM1/26/11
to selenium-deve...@googlegroups.com

Comment #3 on issue 1181 by marcin.floryan: Firefox driver connection
problem
http://code.google.com/p/selenium/issues/detail?id=1181

Thanks. I will attempt this patch and report back.

sele...@googlecode.com

unread,
Jan 31, 2011, 5:02:23 PM1/31/11
to selenium-deve...@googlegroups.com

Comment #4 on issue 1181 by marcin.floryan: Firefox driver connection
problem
http://code.google.com/p/selenium/issues/detail?id=1181

Unfortunately the attached jar doesn't seem to contain the
org.openqa.selenium.networkutils.NetworkUtils class. Has it been moved
elsewhere? I can make an attempt at running the tests with this jar though.

sele...@googlecode.com

unread,
Mar 11, 2011, 12:44:22 PM3/11/11
to selenium-deve...@googlegroups.com

Comment #5 on issue 1181 by vava...@gmail.com: Firefox driver connection
problem
http://code.google.com/p/selenium/issues/detail?id=1181

I have very simple code
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.co.uk");

But,I am getting the following error when using FirefoxDriver. The
following error is thrown. But it works fine for IE. I am using
selenium-java-2.0b2

java.lang.UnsupportedOperationException: Bad request

at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:131)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:105)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:401)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:100)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:87)


at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:121)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:77)

at DriverTests.beforeMethod(DriverTests.java:18)

sele...@googlecode.com

unread,
Apr 12, 2011, 10:17:18 AM4/12/11
to selenium-deve...@googlegroups.com

Comment #6 on issue 1181 by vargat...@gmail.com: Firefox driver connection
problem
http://code.google.com/p/selenium/issues/detail?id=1181

Same error with 127.0.0.2 on my openSUSE 11.2 x86 with 3.6.16
I want to add that ChromeDriver works well.

sele...@googlecode.com

unread,
Apr 13, 2011, 2:21:20 PM4/13/11
to selenium-deve...@googlegroups.com

Comment #7 on issue 1181 by kristian...@gmail.com: Firefox driver
connection problem
http://code.google.com/p/selenium/issues/detail?id=1181

The package for networkUtils has changed somewhat:

org.openqa.selenium.net.NetworkUtils

sele...@googlecode.com

unread,
Apr 13, 2011, 3:07:09 PM4/13/11
to selenium-deve...@googlegroups.com
Updates:
Status: Fixed

Comment #8 on issue 1181 by kristian...@gmail.com: Firefox driver
connection problem
http://code.google.com/p/selenium/issues/detail?id=1181

I'm marking this issues as fixed as of r12004. Please feel free to reopen
if it does not work as expected, and please include the output of "java
-classpath selenium-java-2.0b3.jar org.openqa.selenium.net.NetworkUtils"


sele...@googlecode.com

unread,
Apr 13, 2011, 5:39:22 PM4/13/11
to selenium-deve...@googlegroups.com

Comment #9 on issue 1181 by kristian...@gmail.com: Firefox driver
connection problem
http://code.google.com/p/selenium/issues/detail?id=1181

Digging around in some linux docs, it seems like the preferred binding port
should be the last added, whatever that means in practice. I also see
indications that this can be overridden in distro-specific routing tables
(and set by the administrator).

It would seem by the current data that we might have to go with the
loopback address that has hostName.startsWith("localhost") if the strategy
in r12004 does not work. (r12004 selects the last loopback address in the
list)

sele...@googlecode.com

unread,
Oct 28, 2011, 3:21:13 PM10/28/11
to selenium-deve...@googlegroups.com

Comment #10 on issue 1181 by jpi...@gmail.com: Firefox driver connection
problem
http://code.google.com/p/selenium/issues/detail?id=1181

I'm using Maven, and selenium - and I tried (unsuccessfully) to load an
extension with a new profile. Now, after removing the profile creation
code, etc., every time I try to use FirefoxDriver - get this error:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to

host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:

at
org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:95)
at
org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:149)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:75)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:128)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:79)
at com.entertainment.WebDriverMain$.main(WebDriverMain.scala:43)
at com.entertainment.WebDriverMain.main(WebDriverMain.scala)
Exception in thread "main" org.openqa.selenium.WebDriverException: Failed
to connect to binary FirefoxBinary(C:\Program Files (x86)\Mozilla
Firefox\firefox.exe) on port 7055; process output follows:

Build info: version: '2.10.0', revision: '14416', time: '2011-10-27
23:00:15'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1',
java.version: '1.7.0'


Driver info: driver.version: FirefoxDriver
at

org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:107)
at
org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:149)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:75)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:128)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:79)
at com.entertainment.WebDriverMain$.main(WebDriverMain.scala:43)
at com.entertainment.WebDriverMain.main(WebDriverMain.scala)


Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to

connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console
output:

at
org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:95)
... 6 more
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------

I've tried delete the default profiles to no avail. I'm wondering if I
should just totally remove and re-install FF - or if its something that I
did?

sele...@googlecode.com

unread,
Oct 28, 2011, 3:25:16 PM10/28/11
to selenium-deve...@googlegroups.com

Comment #11 on issue 1181 by jpi...@gmail.com: Firefox driver connection

sele...@googlecode.com

unread,
Jan 12, 2012, 3:03:03 PM1/12/12
to selenium-deve...@googlegroups.com

Comment #12 on issue 1181 by bower.er...@gmail.com: Firefox driver
connection problem
http://code.google.com/p/selenium/issues/detail?id=1181

I was also getting the message:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to
host 127.0.0.1 on port 7055 after 45000 ms.

....

and after some digging found that I had 2 different versions of selenium in
my path. After removing the old version, the problem went away

Reply all
Reply to author
Forward
0 new messages