WebDriver for Firefox:浏览器启动/空页面,挂起2分钟,重新启动,然后testing运行。 为什么?

我正在尝试更新我的Javatesting套件以使用Selenium 3和geckodriver。 但是,我在执行testing命令时看到了这个非常奇怪的行为:

  • Firefox打开了一个空白页面。
  • 它停留约2分钟。
  • 它closures,然后立即重新启动。
  • testing运行并通过。

我使用Selenium 3.0.1,Geckodriver 0.11.1,64位Linux上的Firefox 50.0。

我得到这样的FirefoxDriver:

DesiredCapabilities capabilities = DesiredCapabilities.firefox(); capabilities.setCapability("marionette", true); return new FirefoxDriver(capabilities); 

我在我的Maven conf中设置系统属性webdriver.gecko.driver

 <webdriver.gecko.driver> ${basedir}/src/test/resources/geckodriver </webdriver.gecko.driver> 

我可以错过什么? 非常感谢您的帮助!


我的testing的控制台日志(有三个不同的计时组):

下午3点54分左右

完整日志: https : //justpaste.it/10qn9

主要片段:

 Configuring TestNG with: TestNG652Configurator [VerboseTestNG] RUNNING: Suite: "Surefire test" containing "1" Tests (config: null) [VerboseTestNG] INVOKING CONFIGURATION: "Surefire test" - @BeforeClass com.example.MyTest.classSetUp() [VerboseTestNG] PASSED CONFIGURATION: "Surefire test" - @BeforeClass com.example.MyTest.classSetUp() finished in 384 ms [VerboseTestNG] INVOKING CONFIGURATION: "Surefire test" - @BeforeMethod com.example.MyTest.methodSetUp() 1479999268209 geckodriver INFO Listening on 127.0.0.1:7263 Nov 24, 2016 3:54:28 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end 1479999268435 mozprofile::profile INFO Using profile path /tmp/rust_mozprofile.VYFzbHfCS7iH 1479999268438 geckodriver::marionette INFO Starting browser /usr/bin/firefox 1479999268441 geckodriver::marionette INFO Connecting to Marionette on localhost:56753 (firefox:2956): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed (firefox:2956): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed (firefox:2956): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed (firefox:2956): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed [...] 1479999269312 addons.manager DEBUG Completed startup sequence 1479999269598 Marionette INFO Listening on port 56753 1479999270046 addons.manager DEBUG Starting provider: <unnamed-provider> 1479999270046 addons.manager DEBUG Registering shutdown blocker for <unnamed-provider> 1479999270048 addons.manager DEBUG Provider finished startup: <unnamed-provider> 1479999270094 addons.manager DEBUG Starting provider: PreviousExperimentProvider 1479999270094 addons.manager DEBUG Registering shutdown blocker for PreviousExperimentProvider 1479999270095 addons.manager DEBUG Provider finished startup: PreviousExperimentProvider 1479999270100 DeferredSave.extensions.json DEBUG Starting write 1479999270286 DeferredSave.extensions.json DEBUG Write succeeded 1479999270288 addons.xpi-utils DEBUG XPI Database saved, setting schema version preference to 17 (/usr/lib/firefox/plugin-container:3019): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed (/usr/lib/firefox/plugin-container:3019): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed (/usr/lib/firefox/plugin-container:3019): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed (/usr/lib/firefox/plugin-container:3019): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed 

下午3:55:32左右

完整日志:

 1479999331434 addons.productaddons INFO sending request to: https://aus5.mozilla.org/update/3/GMP/50.0/20161114145022/Linux_x86_64-gcc3/null/release-cck- ubuntu/Linux%203.13.0-101-generic%20(GTK%203.10.8%2Clibpulse%204.0.0)/canonical/1.0/update.xml 1479999332144 addons.productaddons INFO Completed downloading document 1479999332573 addons.productaddons INFO downloadXHR File download. status=200 1479999332581 addons.productaddons INFO Downloaded file will be saved to /tmp/tmpaddon 

下午3点56分35秒左右

完整日志:

 Nov 24, 2016 3:56:35 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C [VerboseTestNG] PASSED CONFIGURATION: "Surefire test" - @BeforeMethod com.example.MyTest.methodSetUp() finished in 129531 ms [VerboseTestNG] INVOKING: "Surefire test" - com.example.MyTest.testSomething() [VerboseTestNG] PASSED: "Surefire test" - com.example.MyTest.testSomething() finished in 1603 ms 

Solutions Collecting From Web of "WebDriver for Firefox:浏览器启动/空页面,挂起2分钟,重新启动,然后testing运行。 为什么?"