我是 selenium webdriver 的新手,我正在尝试运行一个简单的测试:我正在使用 firefox 17.0.1 和 selenium 2.28 尝试了旧版本的 firefox 和 selenium,但它没有用。
但我收到了这个错误:
[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
当我卸载 firefox 并安装它时,测试只适用于第一次。