Selenium 2.48.2 throws exception
Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms
when I'm using Firefox 42.0 64-bit on Windows. With Firefox 42.0 32-bit all works fine.
Update as below:
This issue also reproduce for my test on IE.
Windows 8.1 AMD64
IE11 (11.0.9600.18096)
I can confirm the same results for FF 42 64-bit on Windows 10, 8.1, 8, and 7x64.
It's curious that the port mentioned is 7055, as the normal FF connects at http://127.0.0.1:4444/wd/hub using RemoteWebDriver.
@lkende 7055 is the internal port that we start the firefox driver 'server' inside of the firefox browser plugin. The standalone server runs on 4444 and then after starting up the browser, forwards requests to this other server. (Which is why the second comment on this thread makes no sense and I have no idea how IE could exhibit the same behavior).
This error message means that selenium tried to start up firefox but couldn't get a response from the server started up by our 'webdriver.xpi' (firefox extension). It would be helpful to try and get the browser console logs for when this occurs. (helpful, but might not tell us why exactly it failed). The browser console logs can be brought up by pressing ctrl + shift + J
@lukeis Thanks for the clarification... I suspected. The Firefox browser closes once the the exception is thrown, but here's what I could get from the console logs and another file for the details of the Java's exception. Hope that helps.
I'm getting similar error
org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'xxxxxx', ip: 'xxxxxx', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_60'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.internal.SocketLock.lock(SocketLock.java:100)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:90)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:117)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:128)
Are you folks running things in parallel, or do you only have one instance per node?
No hub, nor parallel requests. Only the one instance of the server and one client request.
I lack further details but I suspect it's possible to have Firefox report as if it has been upgraded when it really has not. I got
Failed to connect to binary FirefoxBinary(C:\FF-Selenium\firefox.exe) on port 7055; process output follows:
1451448230752 addons.manager DEBUG Application has been upgraded
on a machine today morning and Firefox definitely has not upgraded itself. There isn't an update staged and waiting to be applied in Firefox folder either.
Duplicate of #1431
@lukeis Yep, the port 7055 is the internal server, the extension. I'm not sure but I think it's a repl interface. I've installed that extension manually on my server and I can see the port running, but don't know how should I connect it from webdriver.Firefox or even webdriver.Remote(). Also tried using telnet to 7055 and loads httpd.js server from the extension. Is there any documentation to learn it's interface?
I too had the same error but issue is resolved upon downgrading Firefox version to 35.0.1.
I am using selenium 2.43 and Firefox 35.0.1
Just encountered this same issue. The browser window appears for 30 seconds before the Selenium process times out and closes the window again.
If, in those 30 seconds, you type about:addons into the URL then you can see that there is only one addon installed - the WebDriver one - and it is disabled with a big red message that says "Firefox WebDriver could not be verified for use in Firefox and has been disabled".
I am wondering whether this is part of the e10s updates that Mozilla have done, as apparently this has a tendency to break addons, so they may have disabled them all as a precaution until they can be verified. I'm not sure whether it's just a matter of bumping a version number in the .xpi file, or whether it's more complex.
See also https://github.com/SeleniumHQ/selenium/issues/2110.
@adam-nielsen which version of Firefox are you using? The error looks related to addon signing, but addon signing is not enabled in Firefox 47.
@marco-c: I tried it in Firefox 47 then went back to 45 but both are showing the same problem. If I go into about:config before the Selenium instance closes it, xpinstall.signatures.required is true, and xpinstall.whitelist.required is also true. I tried manually changing both these to false, then the addons page said the WebDriver addon would be enabled after a restart, but of course that's not really possible via Selenium.
Perhaps the mini-profile that Selenium creates for Firefox needs to have these two options set to false as well?
@adam-nielsen, I thought Selenium already did that: https://github.com/SeleniumHQ/selenium/blob/c945e6a49cb71ec6e74a126fa3924935c6c13bee/javascript/firefox-driver/webdriver.json#L48
Btw, you can do it yourself, e.g. something similar to https://www.seleniumeasy.com/selenium-tutorials/firefox-profile-preferences-using-selenium-webdriver.
@marco-c: How are those options being set? The filename webdriver.json suggests it's the add-on changing the settings, which of course won't work if Firefox isn't loading the add-on in the first place.
That second link of yours looks like it sets the options without using the add-on, so presumably this would be the only way to get it to work - I'll try it and report back if I have any luck.
That seemed to do the trick. You have to set xpinstall.signatures.required to false manually in the Firefox profile. With PHPUnit and the Facebook code:
$caps = Facebook\WebDriver\Remote\DesiredCapabilities::firefox();
$profile = $caps->getCapability(Facebook\WebDriver\Firefox\FirefoxDriver::PROFILE);
$profile->setPreference("xpinstall.signatures.required", false);
$caps->setCapability(Facebook\WebDriver\Firefox\FirefoxDriver::PROFILE, $profile);
$webDriver = Facebook\WebDriver\Remote\RemoteWebDriver::create(
'http://localhost:4444/wd/hub', $caps
);
The addon then shows up with the message Firefox WebDriver could not be verified for use in Firefox. Proceed with caution. but it works and commands can be sent to the browser.
I guess this is more a fix for the Facebook WebDriver than Selenium itself?
add pom.xml
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.53.1</version>
</dependency>
Most helpful comment
add pom.xml