在我的Ubuntu工作站上本地運行使用Firefox的Selenium(Webdriver)測試不再有效。在Firefox上運行Selenium WebDriver測試不再適用於Ubuntu
完全相同的設置工作之前,但我認爲Firefox升級在某個時候(它現在從Ubuntu包0123.16.0.2),之後它停止工作。在正常使用中,Firefox工作正常。
隨着Webdriver,當我運行一個測試用例(通過我的IDE),一個空的Firefox窗口打開,但測試不啓動。 45秒後,它超時與此錯誤消息:
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.xpi: startup
*** LOG addons.xpi: Ignoring file entry whose name is not a valid add-on ID: /tmp/anonymous5012217980260937474webdriver-profile/extensions/webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi-utils: Opening database
*** LOG addons.xpi: Add-on {2204c510-88f3-11db-b606-0800200c9a66} modified in app-profile
*** LOG addons.xpi: Add-on [email protected] modified in app-profile
*** LOG addons.xpi: Add-on {02450954-cdd9-410f-b1da-db804e18c671} modified in app-profile
*** LOG addons.xpi: Add-on {c45c406e-ab73-11d8-be73-000a95be3b12} modified in app-profile
*** LOG addons.xpi: Add-on {a6fd85ed-e919-4a43-a5af-8da18bda539f} modified in app-profile
*** LOG addons.xpi: Add-on [email protected] modified in app-profile
*** LOG addons.xpi: Add-on [email protected] modified in app-profile
*** LOG addons.xpi: Add-on [email protected] modified in app-profile
*** LOG addons.xpi: Add-on [email protected] modified in app-profile
*** LOG addons.xpi: Add-on [email protected] modified in app-profile
*** LOG addons.xpi: Loading bootstrap scope from /tmp/anonymous5012217980260937474webdriver-profile/extensions/[email protected]
*** LOG addons.xpi: Calling bootstrap method install on [email protected] version 1.10.6
*** LOG addons.xpi: New add-on [email protected] installed in app-profile
*** 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: Calling bootstrap method startup on [email protected] version 1.10.6
*** LOG ubufox.urn: Starting
*** LOG addons.xpi: shutdown
*** LOG addons.xpi-utils: shutdown
*** LOG addons.xpi-utils: Database closed
*** LOG addons.xpi: startup
*** LOG addons.xpi: Ignoring file entry whose name is not a valid add-on ID: /tmp/anonymous5012217980260937474webdriver-profile/extensions/webdriver-staging
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: No changes found
*** LOG addons.xpi: Loading bootstrap scope from /tmp/anonymous5012217980260937474webdriver-profile/extensions/[email protected]
*** LOG addons.xpi: Calling bootstrap method startup on [email protected] version 1.10.6
*** LOG ubufox.urn: Starting
Build info: version: '2.23.1', revision: '17143', time: '2012-06-08 18:59:28'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.38-16-generic', java.version: '1.6.0_26'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:113)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:216)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:93)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:156)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:151)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:93)
at fi.company.product.testing.selenium.AbstractSeleniumTest.getFirefoxDriver(AbstractSeleniumTest.java:99)
at fi.company.product.testing.selenium.AbstractSeleniumTest.setup(AbstractSeleniumTest.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at fi.company.product.testing.selenium.ScreenshotTestRule$1.evaluate(ScreenshotTestRule.java:27)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:24)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
在我們的基本測試類中,FirefoxDriver
被初始化僅僅是這樣的:
new FirefoxDriver(new FirefoxProfile())
...雖然我也嘗試指向一個現有的Firefox配置文件目錄(類似/home/jonik/.mozilla/firefox/vds3ono5.default
)具有相同的結果。
任何想法如何讓測試再次運行?
- 硒(webdriver的)2.23.1
- 火狐16.0.2
- Ubuntu的11.04
如果問題中缺少某些重要信息,請指出! (也可以隨意遷移到另一個SE網站,這適合更好的地方。) – Jonik