1

I am new to selenium webdriver and using selenium-server-standalone-2.39.0.jar with Firefox 25.0.

Here is my code :

package org.cost;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class First_Program {
    WebDriver driver;
    @BeforeTest
    public void beforetest(){

        driver= new FirefoxDriver();
        System.out.println("testing");
        driver.manage().window().maximize();

    }
    @Test
    public void test(){
        System.out.println("hello");
        driver.get("http://www.rediff.com/");
        driver.findElement(By.xpath("//*[@id='signin_info']/a[1]")).click();
        driver.findElement(By.xpath("//*[@id='c_uname']")).sendKeys("hello");


    }

}

When i run this code, Firefox window get launched but after some time i am getting following error :

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
*** LOG addons.manager: Application has been upgraded
*** 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: C:\Users\User\AppData\Local\Temp\anonymous1906693611994803668webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi-utils: Opening database
*** LOG addons.xpi-utils: Creating database schema
*** LOG addons.xpi: New add-on fxdriver@googlecode.com installed in app-profile
*** LOG addons.xpi: New add-on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} installed in app-global
*** LOG addons.xpi: Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
*** WARN addons.xpi: Failed to add URI mapping: TypeError: this.enabledAddons.split is not a function (resource://gre/modules/XPIProvider.jsm:1562)
*** LOG addons.xpi: Calling bootstrap method install on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 7.2.15747.10003
*** LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
*** LOG addons.xpi: New add-on {22C7F6C6-8D67-4534-92B5-529A0EC09405} installed in winreg-app-global
*** 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 addons.xpi: Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
*** LOG addons.xpi: Calling bootstrap method startup on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 7.2.15747.10003
*** LOG addons.manager: shutdown
*** LOG addons.xpi: shutdown
*** LOG addons.xpi-utils: shutdown
*** LOG addons.xpi-utils: Database closed
*** 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: C:\Users\User\AppData\Local\Temp\anonymous1906693611994803668webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: No changes found
*** LOG addons.xpi: Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
*** LOG addons.xpi: Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
*** LOG addons.xpi: Calling bootstrap method startup on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 7.2.15747.10003
JavaScript error: chrome://browser/content/urlbarBindings.xml, line 654: aUrl is undefined

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:109)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:245)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:109)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:185)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:178)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:174)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:92)
    at org.cost.First_Program.beforetest(First_Program.java:15)
    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.invokeConfigurationMethod(Invoker.java:564)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
    at org.testng.TestRunner.beforeRun(TestRunner.java:641)
    at org.testng.TestRunner.run(TestRunner.java:609)
    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)
FAILED CONFIGURATION: @BeforeTest beforetest
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files (x86)\Mozilla Firefox\firefox.exe) on port 7055; process output follows: 
*** LOG addons.manager: Application has been upgraded
*** 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: C:\Users\User\AppData\Local\Temp\anonymous1906693611994803668webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi-utils: Opening database
*** LOG addons.xpi-utils: Creating database schema
*** LOG addons.xpi: New add-on fxdriver@googlecode.com installed in app-profile
*** LOG addons.xpi: New add-on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} installed in app-global
*** LOG addons.xpi: Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
*** WARN addons.xpi: Failed to add URI mapping: TypeError: this.enabledAddons.split is not a function (resource://gre/modules/XPIProvider.jsm:1562)
*** LOG addons.xpi: Calling bootstrap method install on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 7.2.15747.10003
*** LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
*** LOG addons.xpi: New add-on {22C7F6C6-8D67-4534-92B5-529A0EC09405} installed in winreg-app-global
*** 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 addons.xpi: Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
*** LOG addons.xpi: Calling bootstrap method startup on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 7.2.15747.10003
*** LOG addons.manager: shutdown
*** LOG addons.xpi: shutdown
*** LOG addons.xpi-utils: shutdown
*** LOG addons.xpi-utils: Database closed
*** 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: C:\Users\User\AppData\Local\Temp\anonymous1906693611994803668webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: No changes found
*** LOG addons.xpi: Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
*** LOG addons.xpi: Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
*** LOG addons.xpi: Calling bootstrap method startup on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 7.2.15747.10003
JavaScript error: chrome://browser/content/urlbarBindings.xml, line 654: aUrl is undefined

Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 21:09:54'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_21'
Driver info: driver.version: FirefoxDriver
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:121)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:245)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:109)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:185)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:178)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:174)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:92)
    at org.cost.First_Program.beforetest(First_Program.java:15)
    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.invokeConfigurationMethod(Invoker.java:564)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
    at org.testng.TestRunner.beforeRun(TestRunner.java:641)
    at org.testng.TestRunner.run(TestRunner.java:609)
    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: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
*** LOG addons.manager: Application has been upgraded
*** 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: C:\Users\User\AppData\Local\Temp\anonymous1906693611994803668webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi-utils: Opening database
*** LOG addons.xpi-utils: Creating database schema
*** LOG addons.xpi: New add-on fxdriver@googlecode.com installed in app-profile
*** LOG addons.xpi: New add-on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} installed in app-global
*** LOG addons.xpi: Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
*** WARN addons.xpi: Failed to add URI mapping: TypeError: this.enabledAddons.split is not a function (resource://gre/modules/XPIProvider.jsm:1562)
*** LOG addons.xpi: Calling bootstrap method install on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 7.2.15747.10003
*** LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
*** LOG addons.xpi: New add-on {22C7F6C6-8D67-4534-92B5-529A0EC09405} installed in winreg-app-global
*** 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 addons.xpi: Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
*** LOG addons.xpi: Calling bootstrap method startup on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 7.2.15747.10003
*** LOG addons.manager: shutdown
*** LOG addons.xpi: shutdown
*** LOG addons.xpi-utils: shutdown
*** LOG addons.xpi-utils: Database closed
*** 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: C:\Users\User\AppData\Local\Temp\anonymous1906693611994803668webdriver-profile\extensions\webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: No changes found
*** LOG addons.xpi: Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
*** LOG addons.xpi: Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
*** LOG addons.xpi: Calling bootstrap method startup on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 7.2.15747.10003
JavaScript error: chrome://browser/content/urlbarBindings.xml, line 654: aUrl is undefined

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:109)
    ... 29 more

SKIPPED: test

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


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

[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@22c6bb6c: 158 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@12a312c6: 262 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@5b390546: 36 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 22 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@74e0e49f: 91 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@41ce5a9: 16 ms

Please suggest me, what i am doing wrong here?

Thanks

deepak.mr888
  • 349
  • 2
  • 11
  • 26

2 Answers2

0

Please update your selenium standalone jar file to its latest and even firefox browser also and then try to run the script.

Selenium standalone 2.41x or 2.42x firefox ...first try with your version only, if u still get the problem, try upgrade to latest version.

Thank you,

Shravan Kumar.T

Shr4N
  • 435
  • 3
  • 18
0

Here is the change log which will helps you to choose firefox version (for Java)

https://github.com/SeleniumHQ/selenium/blob/master/java/CHANGELOG

I hope for latest standalone jar , firefox 39 does not have any issues. In my work space i am using FF 31 with latest jar as per requirement. I dont have any connection issues like these..

Thank You

murali selenium
  • 3,847
  • 2
  • 11
  • 20