2012-12-04 66 views
1

在我的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
+0

如果问题中缺少某些重要信息,请指出! (也可以随意迁移到另一个SE网站,这适合更好的地方。) – Jonik

回答

5

火狐16未在v2.23支持。您必须升级到v2.26或降级Firefox。

+0

谢谢;更新到2.26.0,它再次运作很好! – Jonik

+1

有一点需要注意:在[SeleniumHQ](http://seleniumhq.org/download/)中,最新版本是2.25;没有提及2.26!但是我在Selenium的Google Code下载页面找到了2.26(http://code.google.com/p/selenium/downloads/list)。 – Jonik

相关问题