使用firefox 28,selenium2.35.0时,报错
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
tensions\\[email protected]","mtime":1406253406712},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253407262,"rdfTime":1392884482000},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253407274},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409228,"rdfTime":1395041894000},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409248},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253401162,"rdfTime":1406253401021},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409357},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409471},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409575}}}]
*** LOG addons.xpi-utils: Opening XPI database C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions.json
*** LOG addons.xpi-utils: Successfully read XPI database
*** LOG addons.xpi: No changes found
*** LOG addons.xpi: Registering manifest for C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Loading bootstrap scope from C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 1.0.11
*** LOG addons.xpi: Registering manifest for C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Loading bootstrap scope from C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 0.7
*** LOG addons.xpi: Registering manifest for C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Loading bootstrap scope from C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 0.2
*** LOG addons.xpi: Registering manifest for C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Loading bootstrap scope from C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 1.0.2
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
*** ERROR COBA: Failed to hook function: getShortcutOrURI
*** LOG addons.repository: No addons.json found.
*** LOG DeferredSave/addons.json: Save changes
*** LOG DeferredSave/addons.json: Starting timer
*** LOG DeferredSave/addons.json: Starting write
*** LOG DeferredSave/addons.json: Write succeeded
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:106)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:251)
at org.openqa.selenium.remote.RemoteWebDriver.
at org.openqa.selenium.firefox.FirefoxDriver.
at org.openqa.selenium.firefox.FirefoxDriver.
at org.openqa.selenium.firefox.FirefoxDriver.
at org.openqa.selenium.firefox.FirefoxDriver.
at automation.ewsProject.index.IndexBasic95d9991acaad4664bd638c6a6f354397.setUp_ChromeDriver(IndexBasic95d9991acaad4664bd638c6a6f354397.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
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.SuiteRunner.privateRun(SuiteRunner.java:277)
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: @BeforeSuite setUp_ChromeDriver
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files\Mozilla Firefox\firefox.exe) on port 7055; process output follows:
tensions\\[email protected]","mtime":1406253406712},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253407262,"rdfTime":1392884482000},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253407274},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409228,"rdfTime":1395041894000},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409248},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253401162,"rdfTime":1406253401021},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409357},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409471},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409575}}}]
*** LOG addons.xpi-utils: Opening XPI database C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions.json
*** LOG addons.xpi-utils: Successfully read XPI database
*** LOG addons.xpi: No changes found
*** LOG addons.xpi: Registering manifest for C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Loading bootstrap scope from C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 1.0.11
*** LOG addons.xpi: Registering manifest for C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Loading bootstrap scope from C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 0.7
*** LOG addons.xpi: Registering manifest for C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Loading bootstrap scope from C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 0.2
*** LOG addons.xpi: Registering manifest for C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Loading bootstrap scope from C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 1.0.2
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
*** ERROR COBA: Failed to hook function: getShortcutOrURI
*** LOG addons.repository: No addons.json found.
*** LOG DeferredSave/addons.json: Save changes
*** LOG DeferredSave/addons.json: Starting timer
*** LOG DeferredSave/addons.json: Starting write
*** LOG DeferredSave/addons.json: Write succeeded
Build info: version: '2.35.0', revision: '8df0c6b', time: '2013-08-12 15:43:19'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:251)
at org.openqa.selenium.remote.RemoteWebDriver.
at org.openqa.selenium.firefox.FirefoxDriver.
at org.openqa.selenium.firefox.FirefoxDriver.
at org.openqa.selenium.firefox.FirefoxDriver.
at org.openqa.selenium.firefox.FirefoxDriver.
at automation.ewsProject.index.IndexBasic95d9991acaad4664bd638c6a6f354397.setUp_ChromeDriver(IndexBasic95d9991acaad4664bd638c6a6f354397.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
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.SuiteRunner.privateRun(SuiteRunner.java:277)
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:
tensions\\[email protected]","mtime":1406253406712},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253407262,"rdfTime":1392884482000},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253407274},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409228,"rdfTime":1395041894000},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409248},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253401162,"rdfTime":1406253401021},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409357},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409471},"[email protected]":{"descriptor":"C:\\Users\\liuru\\AppData\\Local\\Temp\\anonymous123678787491609026webdriver-profile\\extensions\\[email protected]","mtime":1406253409575}}}]
*** LOG addons.xpi-utils: Opening XPI database C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions.json
*** LOG addons.xpi-utils: Successfully read XPI database
*** LOG addons.xpi: No changes found
*** LOG addons.xpi: Registering manifest for C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Loading bootstrap scope from C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 1.0.11
*** LOG addons.xpi: Registering manifest for C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Loading bootstrap scope from C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 0.7
*** LOG addons.xpi: Registering manifest for C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Loading bootstrap scope from C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 0.2
*** LOG addons.xpi: Registering manifest for C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Loading bootstrap scope from C:\Users\liuru\AppData\Local\Temp\anonymous123678787491609026webdriver-profile\extensions\[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 1.0.2
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
*** ERROR COBA: Failed to hook function: getShortcutOrURI
*** LOG addons.repository: No addons.json found.
*** LOG DeferredSave/addons.json: Save changes
*** LOG DeferredSave/addons.json: Starting timer
*** LOG DeferredSave/addons.json: Starting write
*** LOG DeferredSave/addons.json: Write succeeded
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:106)
... 25 more
上网查一下:
webdriver启动firefox时如果遇到以下错误,则说明selenium的版本和firefox不兼容了,需要升级selenium:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055
Selenium ->FireFox
2.25.0 -> 18
2.30.0 ->19
2.31.0 ->20
升级selenium jar包
正常启动firefox