[webdriver] Failed to connect to binary FirefoxBinary(C:\Program Files\Mozilla Firefox\firefox.exe) on port 7055

3,439 views
Skip to first unread message

Kai

unread,
Feb 4, 2010, 8:22:07 PM2/4/10
to webdriver
Hi,

I have a simple test where I am trying to tell Webdriver to use a
certain Firefox Profile (where name of the profile is default), but it
does not seem to work. I tried with Webdriver version 0.6.1039 and the
latest Selenium 2.0a build.


System.setProperty("webdriver.firefox.profile", "default");

WebDriver driver = new FirefoxDriver();

driver.get("http://www.google.com/");

It starts up the firefox browser but fails to get to the "driver.get"
step.

It throws the following error:

Exception in thread "main" org.openqa.selenium.WebDriverException:
org.openqa.selenium.WebDriverException: Failed to connect to binary
FirefoxBinary(C:\Program Files\Mozilla Firefox\firefox.exe) on port
7055; process output follows:
ÿ
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
java.version: '1.6.0_17'
Driver info: driver.version: firefox
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
java.version: '1.6.0_17'
Driver info: driver.version: firefox
at
org.openqa.selenium.firefox.internal.ExtensionConnectionFactory.connectTo(ExtensionConnectionFactory.java:
46)
at
org.openqa.selenium.firefox.FirefoxDriver.connectTo(FirefoxDriver.java:
139)
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:
129)
at
org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:
109)
at MyTest.main(MyTest.java:14)

Thanks,
Kai

Simon Stewart

unread,
Feb 5, 2010, 8:55:24 AM2/5/10
to webd...@googlegroups.com
Hi,

A few questions:

1) Did you try and install the webdriver firefox extension by hand? If
so, please remove it because webdriver will add it automatically

2) Is there a "WebDriver" label in the bottom right of the status bar?

3) Is there anything reported in the Javascript error console?

Regards,

Simon

> --
> You received this message because you are subscribed to the Google Groups "webdriver" group.
> To post to this group, send email to webd...@googlegroups.com.
> To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
>
>

Kai

unread,
Feb 5, 2010, 1:53:07 PM2/5/10
to webdriver
Hi,

1) Did you try and install the webdriver firefox extension by hand?
If
so, please remove it because webdriver will add it automatically

- No, I just downloaded firefox and installed firebug and yslow on my
default profile and wanted fire up that profile when running Webdriver
tests.
And I have a Maven project with the following dependency to bring in
the Webdriver jars

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium</artifactId>
<version>2.0a2</version>
</dependency>

2) Is there a "WebDriver" label in the bottom right of the status
bar?

No, when I have this line in my code to tell Webdriver to use my
default profile, firefox starts without the Webdriver label and I get
a connection exception:

System.setProperty("webdriver.firefox.profile", "default");

3) Is there anything reported in the Javascript error console?

Yes, I see these two errors in the error console:

1. Error: Warning: unrecognized command line flag --verbose
Source File: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsBrowserContentHandler.js
Line: 742

2. Error: [Exception... "Component returned failure code: 0x80004005
(NS_ERROR_FAILURE) [nsIWebNavigation.sessionHistory]" nsresult:
"0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
chrome://global/content/bindings/browser.xml :: :: line 637" data:
no]
Source File: chrome://global/content/bindings/browser.xml
Line: 643

Thanks for your help,
Kai

> > org.openqa.selenium.firefox.internal.ExtensionConnectionFactory.connectTo(E­xtensionConnectionFactory.java:


> > 46)
> >        at
> > org.openqa.selenium.firefox.FirefoxDriver.connectTo(FirefoxDriver.java:
> > 139)
> >        at
> > org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:
> > 129)
> >        at
> > org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:
> > 109)
> >        at MyTest.main(MyTest.java:14)
>
> > Thanks,
> > Kai
>
> > --
> > You received this message because you are subscribed to the Google Groups "webdriver" group.
> > To post to this group, send email to webd...@googlegroups.com.
> > To unsubscribe from this group, send email to webdriver+...@googlegroups.com.

> > For more options, visit this group athttp://groups.google.com/group/webdriver?hl=en.- Hide quoted text -
>
> - Show quoted text -

karlmichael

unread,
Feb 5, 2010, 2:22:35 PM2/5/10
to webdriver
I had the same problem on multiple Windows machines, whereas on Linux
this problem has never occurred. So I did some research into this. I
also tell webdriver to run Firefox with an existing profile.

Webdriver 2.0a2 runs Firefox twice (or even three times), first with
the --silent commandline option (to clean the profile?) which does not
bring up a browser window, then without --silent which is supposed to
bring up the browser window. I observed that after the first Firefox
process (--silent) there was another Firefox process (no --silent)
which often went away after about a second, and then the webdriver
client kept waiting until the timeout and threw the "cannot connect to
Firefox binary" exception. My suspicion is that this is a Windows
problem and that the second Firefox process is still seeing the first
one (which has already terminated) and then terminates because it
thinks another Firefox process is already running. It might also be a
filesystem caching problem with the Firefox lock file.

I then wrapped a small batch script around Firefox to wait for 5
seconds after Firefox has shut down:

@ECHO OFF
"%PROGRAMFILES%\Mozilla Firefox\firefox.exe" %1 %2 %3 %4 %5
REM sleep for 5 seconds
PING -n 5 127.0.0.1 >nul

Set the webdriver.firefox.bin system property to the path of this
script, so webdriver runs Firefox through this script rather than
directly. This solved the problem.

> > > For more options, visit this group athttp://groups.google.com/group/webdriver?hl=en.-Hide quoted text -

Simon Stewart

unread,
Feb 7, 2010, 10:46:26 AM2/7/10
to webd...@googlegroups.com
Hi,

We saw the same behaviour for Firefox on OS X. Seems like we need to
come up with a smarter way of dealing with this.

Simon

Simon Stewart

unread,
Feb 7, 2010, 12:03:04 PM2/7/10
to webd...@googlegroups.com
Hi,

From what you say, we're starting firefox up, but for some reason
we're not extracting our extension properly. That's a regression, and
I should fix it.

Simom

Neo

unread,
Feb 8, 2010, 6:08:01 AM2/8/10
to webdriver
Hey,

Yes, I face the same problem. When using an existing profile and
running the file
- Firefox window is opened(Without the webdriver at the bottom right)
- A new directory "extensions" is created in the profile directory
So I guess there is a problem in extracting the extension.

Regards,
Neo

On Feb 7, 10:03 pm, Simon Stewart <simon.m.stew...@gmail.com> wrote:
> Hi,
>

> From what you say, we're starting firefox up, but for some reason
> we're not extracting our extension properly. That's a regression, and
> I should fix it.
>
> Simom
>

> >> > latestSelenium2.0a build.

> >> > For more options, visit this group athttp://groups.google.com/group/webdriver?hl=en.-Hide quoted text -

Simon Stewart

unread,
Feb 8, 2010, 7:50:09 AM2/8/10
to webd...@googlegroups.com
This should be fixed in r8289. There are some more changes coming in
order to make this more robust.

http://code.google.com/p/selenium/source/detail?r=8289

Regards,

Simon

Kai

unread,
Feb 8, 2010, 6:30:52 PM2/8/10
to webdriver
Thanks Karl for the script!

Also, I realized that Webdriver allows you to kickoff a Webdriver
instance with a firefox profile. So, you can add your extensions to a
firefox profile, set any preferences you want, then instantiate
Webdriver with that profile instance. It works beautifully! :)

> >> >   Source File: file:///C:/Program%20Files/Mozilla%20Firefox/components/nsBrowserContentHan­dler.js

> >> >> > For more options, visit this group athttp://groups.google.com/group/webdriver?hl=en.-Hidequoted text -


>
> >> >> - Show quoted text -
>
> >> > --
> >> > You received this message because you are subscribed to the Google Groups "webdriver" group.
> >> > To post to this group, send email to webd...@googlegroups.com.
> >> > To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
> >> > For more options, visit this group athttp://groups.google.com/group/webdriver?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups "webdriver" group.
> > To post to this group, send email to webd...@googlegroups.com.
> > To unsubscribe from this group, send email to webdriver+...@googlegroups.com.

> > For more options, visit this group athttp://groups.google.com/group/webdriver?hl=en.- Hide quoted text -

Eran M.

unread,
Feb 9, 2010, 3:16:00 PM2/9/10
to webd...@googlegroups.com
Hi,
If your only concern is adding extensions to Firefox, you could create a FirefoxProfile instance, add the desired extensions (and set preferences) and then create a new FirefoxDriver with this profile. Of course, since Simon has fixed the issues with existing profiles, the original approach should work just fine - so hopefully you have not one, but two solutions for your problem...

Regards,
Eran

Neo

unread,
Feb 9, 2010, 3:50:08 PM2/9/10
to webdriver
Hello,

Adding extensions is a valid concern. However, the reason I generally
prefer an existing profile is the low start up time; especially during
development work. Nevertheless, thanks for the alternative.

Regards,
Neo

On Feb 10, 1:16 am, "Eran M." <eran....@gmail.com> wrote:
> Hi,
> If your only concern is adding extensions to Firefox, you could create a
> FirefoxProfile instance, add the desired extensions (and set preferences)
> and then create a new FirefoxDriver with this profile. Of course, since
> Simon has fixed the issues with existing profiles, the original approach
> should work just fine - so hopefully you have not one, but two solutions for
> your problem...
>
> Regards,
> Eran
>

> > webdriver+...@googlegroups.com<webdriver%2Bunsu...@googlegroups.com>


> > .
> > > >> >> > For more options, visit this group athttp://
> > groups.google.com/group/webdriver?hl=en.-Hidequoted text -
>
> > > >> >> - Show quoted text -
>
> > > >> > --
> > > >> > You received this message because you are subscribed to the Google
> > Groups "webdriver" group.
> > > >> > To post to this group, send email to webd...@googlegroups.com.
> > > >> > To unsubscribe from this group, send email to

> > webdriver+...@googlegroups.com<webdriver%2Bunsu...@googlegroups.com>


> > .
> > > >> > For more options, visit this group athttp://
> > groups.google.com/group/webdriver?hl=en.
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups "webdriver" group.
> > > > To post to this group, send email to webd...@googlegroups.com.
> > > > To unsubscribe from this group, send email to

> > webdriver+...@googlegroups.com<webdriver%2Bunsu...@googlegroups.com>


> > .
> > > > For more options, visit this group athttp://

> > groups.google.com/group/webdriver?hl=en.- Hide quoted text -
>
> > > - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "webdriver" group.
> > To post to this group, send email to webd...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > webdriver+...@googlegroups.com<webdriver%2Bunsu...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages