3

i'm new to selenium webdriver i'm trying to run a simple test : i'm using firefox 17.0.1 and selenium 2.28 itried old version of firefox and selenium but it didn't work .

but i'm getting this error :

[TestNG] Running:
  C:\Users\Amira\AppData\Local\Temp\testng-eclipse--387650463\testng-customsuite.xml

FAILED: testApp
org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms
Build info: version: '2.28.0', revision: '18309', time: '2012-12-11 15:53:30'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_05'
Driver info: driver.version: FirefoxDriver
    at org.openqa.selenium.internal.SocketLock.lock(SocketLock.java:94)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:72)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:244)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:110)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:188)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:183)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:179)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:92)
    at GoogleNavigationTest.testApp(GoogleNavigationTest.java:25)
    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:80)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:128)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    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:1203)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1128)
    at org.testng.TestNG.run(TestNG.java:1036)
    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)


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


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

[TestNG] Time taken by org.testng.reporters.jq.Main@985016: 96 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@191c263: 22 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@4b7c69: 62 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@18e5ebd: 9 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@e5025: 8 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 9 ms

when i uninstall firefox and install it the test only work for the first time.

Lucifer
  • 29,392
  • 25
  • 90
  • 143
Amira
  • 3,184
  • 13
  • 60
  • 95
  • 1
    which lower ff version have you tried with? Also, you mention uninstall firefox and install it - it means which version? With the lower version as well you get the same error? – niharika_neo Dec 22 '12 at 06:33
  • @niharika_neo , sorry for late reply i tried ff 13 , 12 ... so can you give me a compatible version i mean selenium and firefox , i tried to execute the selenium tests on another machine and the problem persist . Many thanks – Amira Dec 23 '12 at 13:33
  • Well..those versions shud have worked. Heres something u can try... Uninstall ff and then try installing ff. currently I work with 2.25 and ff16 without issues.. – niharika_neo Dec 23 '12 at 16:15
  • I'm having the same issue with FF 18.0 and Selenium 2.28.0 – Jannie Theunissen Jan 17 '13 at 09:41
  • @JannieT try to use chromeDriver . i didn't find a solution with FF :( – Amira Jan 20 '13 at 18:26
  • 1
    @AmiraGL I got it working in the end: [Selenium WebDriver - Firefox](http://stackoverflow.com/questions/11508429/selenium-webdriver-firefox-unable-to-bind-to-locking-port-within-45000-ms/14376931#14376931) – Jannie Theunissen Jan 21 '13 at 13:47

4 Answers4

3

I had the same problem. There are several solutions of this problem:

At first you should check the port in cmd using: netstat -np TCP | find "7054"

-if port is busy you should:

Delete process that use this port or set other port for firefox, using: `profile.setPreference(PORT_PREFERENCE, port);`

-if port is free:

  1. Upgrade your selenium server to version 2.39 or higher.
  2. Add more nodes if you use selenium grid.
2

Check you hosts file C:\Windows\System32\drivers\etc. Have you ever set something like this

192.168.60.133  localhost:

Delete it then try it.

nickhar
  • 19,981
  • 12
  • 60
  • 73
2

Make sure that you don't have any WebDriver Firefox windows open!

Joel Christophel
  • 2,604
  • 4
  • 30
  • 49
1

You Need to end the process of java in task manager , At times if driver.quit is not called or executed it happens

Raghuveer
  • 115
  • 2
  • 10