top of page

org.openqa.selenium.firefox.NotConnectedException Unable to connect to host 127.0.0.1 on port 7055

  • Writer: khyati sehgal
    khyati sehgal
  • May 28, 2014
  • 3 min read

Hi every one , I have started working on selenium some years back and there are multiple issues which I have seen from the beginning of my career. Today I will share a resolution of an issue which is most common and if you go through the error log you will not get any clue what the issue is all about .

ERROR LOG

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
e":"app-profile","addons":{"fxdriver@googlecode.com":{"descriptor":"C:\\Users\\user\\AppData\\Local\\
Temp\\anonymous6135387285613883684webdrive
r-profile\\extensions\\fxdriver@googlecode.com","mtime":1401263303796,
"rdfTime":1401263302299}}}]
LOG addons.xpi-utils: Opening XPI database C:\Users\user\AppData\Local\Temp\
anonymous6135387285613883684webdriver-profile\extensions.json
*** LOG addons.xpi: New add-on fxdriver@googlecode.com installed in app-profile
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
*** LOG addons.xpi-utils: Make addon app-profile:fxdriver@googlecode.com visible
*** LOG DeferredSave/extensions.json: Save changes
*** LOG DeferredSave/extensions.json: Save changes
*** LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd}

 installed in app-global
*** LOG addons.xpi-utils: Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} 

visible
*** LOG DeferredSave/extensions.json: Save changes
*** LOG DeferredSave/extensions.json: Save changes
*** LOG addons.xpi: New add-on otis@digitalpersona.com installed in winreg-app-global
*** LOG addons.xpi-utils: Make addon winreg-app-global:otis@digitalpersona.com visible
*** LOG DeferredSave/extensions.json: Save changes
*** LOG DeferredSave/extensions.json: Save changes
*** LOG addons.xpi: New add-on ext@VideoPlayerV3beta652.net installed in winreg-app-global
*** LOG addons.xpi-utils: Make addon winreg-app-global:ext@VideoPlayerV3beta652.net visible
*** LOG DeferredSave/extensions.json: Save changes
*** LOG DeferredSave/extensions.json: Save changes
*** LOG addons.xpi: New add-on ext@MediaPlayerV1alpha512.net installed in winreg-app-global
*** LOG addons.xpi-utils: Make addon winreg-app-global:ext@MediaPlayerV1alpha512.net visible
*** LOG DeferredSave/extensions.json: Save changes
*** LOG DeferredSave/extensions.json: Save changes
*** LOG addons.xpi: New add-on {55A8EC97-6AF6-442c-877F-11C51DBD162D} installed in winreg-app-global
*** LOG addons.xpi-utils: Make addon winreg-app-global:{55A8EC97-6AF6-442c-877F-11C51DBD162D} visible
*** LOG DeferredSave/extensions.json: Save changes
*** LOG DeferredSave/extensions.json: Save changes
*** LOG addons.xpi: Updating database with changes to installed add-ons
*** LOG addons.xpi-utils: Updating add-on states
*** LOG addons.xpi-utils: Writing add-ons list
*** LOG DeferredSave/extensions.json: Starting timer
*** LOG DeferredSave/extensions.json: Starting write
*** LOG DeferredSave/extensions.json: Write succeeded
*** LOG addons.xpi-utils: XPI Database saved, setting schema version preference to 16
*** LOG addons.manager: shutdown
*** LOG addons.xpi: shutdown
*** LOG addons.xpi-utils: shutdown
*** LOG addons.xpi: Notifying XPI shutdown observers
*** LOG addons.manager: Async provider shutdown done
System JS : ERROR resource://gre/modules/BookmarkHTMLUtils.jsm:798 - NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsINavBookmarksService.removeFolderChildren]
System JS : ERROR resource://app/components/nsBrowserGlue.js:1713 - NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIAnnotationService.getItemsWithAnnotation]
System JS : ERROR resource://gre/modules/BookmarkHTMLUtils.jsm:835 - NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsINavBookmarksService.runInBatchMode]
*** LOG addons.xpi: startup
*** LOG addons.xpi: Skipping unavailable install location app-system-local
*** LOG addons.xpi: Skipping unavailable install location app-system-share
*** LOG addons.xpi: Ignoring file entry whose name is not a valid add-on ID:
 

Step-wise approach with solution

I have written a test script which actually does a log in to my application and does some basic checks. So what all I did is I have made a Junit test class and made some functions like this:

Set up function:

@Before // A junit annotation which will execute before each test
public void setUp() throws Exception {
FirefoxDriver wd = new FirefoxDriver();
wd.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS); // apply implicit wait to driver instance
}
 

Tear down function:

@After // A junit annotation which will execute after each test
public void tearDown() { //create a method namely teardown
FirefoxDriver wd.quit(); // quit is a webdriver method.
} 

And some test:

@Test // Annotation which junit provides
public void TestLogIn
() {
wd.get("http://ABC.login"); // Get the url given in " "
wd.findElement(By.name("j_username")).click();// Click on username field
wd.findElement(By.name("j_username")).sendKeys("abc"); // Type user name in the field
wd.findElement(By.name("j_password")).click(); // Click on password field
wd.findElement(By.name("j_password")).sendKeys("123"); // Type password in the field
wd.findElement(By.name("submit")).click(); // Click on submit button.
} 

When I was trying to run this test script then I was facing issue which I mentioned earlier.

Environment set up

  1. Operating system : windows 7

  2. Selenium Jar : selenium-server-standalone-2.28.jar

  3. Programming language : Java

  4. Unit test framework : Junit

  5. Browser : Firefox 29

Solution:

  1. I tried un-installing FireFox as the problem was only of FireFox. That dint help me at all .

  2. I tried un-installing all plug-ins from Firefox . As in the exception there was a line stating : LOG addons.xpi-utils: Make addon app-profile:fxdriver@googlecode.com visible

That dint work as well.

  1. Then I cleared temp of my local to clear app data.

"app-profile","addons":{"fxdriver@googlecode.com":{"descriptor":"C:\\Users\\user\\AppData\\Local\\Temp\\anonymous6135387285613883684webdriver-
 

This was also a bad attempt.

The Solution:

What you need to do is to update you selenium stand-alone jar to latest . I took selenium-server-standalone-2.41.jar . Take the latest jar (selenium-server-standalone-X.jar)

What all steps you need to do for this ?

Download selenium jar .

Set Up Development environment.

  1. Go to Eclipse (IDE )

  2. Right click on the project

  3. Select last option > properties.

  4. Go to Java Build Path

  5. Add latest selenium jar .

<a href="http://khyatisehgal.files.wordpress.com/2014/05/standalonejar.pn>
<img class="aligncenter size-full wp-image-216" src="http://khyatisehgal.files.wordpress.com/2014/05/standalonejar.png" alt="StandAloneJar" width="676" height="526" /></a>;
 
  1. Click Ok and rebuild your project.

Now execute the scripts which you were trying before. It will work.

This solution worked for me .

Please let me know , if you have any input or queries .

Comments


bottom of page