WebDriver for Firefox:浏览器启动w /空页,挂起2分钟,重启,然后测试运行。为什么? [英] WebDriver for Firefox: browser starts w/ empty page, hangs for 2 min, restarts, then test runs. Why?

查看:116
本文介绍了WebDriver for Firefox:浏览器启动w /空页,挂起2分钟,重启,然后测试运行。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to update my Java test suite to use Selenium 3 and geckodriver. However, I see this very strange behavior on executing the test command:


  • Firefox打开一个空白页面。

  • 它保持这样大约2分钟。

  • 它关闭然后立即重新启动。

  • 测试运行并通过。

  • Firefox opens up to a blank page.
  • It stays like this for about 2 minutes.
  • It closes and then immediately restarts.
  • The test runs and passes.

我在64位Linux上使用Selenium 3.0.1,geckodriver 0.11.1,Firefox 50.0。

I use Selenium 3.0.1, geckodriver 0.11.1, Firefox 50.0 on 64-bit Linux.

我像这样获得FirefoxDriver:

I obtain FirefoxDriver like this:

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

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

I'm setting the system property webdriver.gecko.driver in my Maven conf:

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

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

What could I be missing? Many thanks for any help!

我的测试的控制台日志(有三个不同的时间组):

Console logs for my tests (with three distinct timing groups):

完整日志: 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



完整日志:

around 3:55:32 PM

Full log:

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



完整日志:

around 3:56:35 PM

Full log:

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


推荐答案

这问题类似于之前发现的问题。建议使用Selenium 3.3.1和gecko驱动程序大于0.14。

This issues looks similar to previously identified issue. The recommendation is to use Selenium 3.3.1 and gecko driver greater than 0.14.

添加到Firefox 50有一个错误影响Web驱动程序注入脚本中的超时。此错误已得到修复,应该可以在Firefox 51 +

Adding to it Firefox 50 has a bug that affects timeouts in web driver injected scripts. This bug has been fixed, and should work in Firefox 51+

这篇关于WebDriver for Firefox:浏览器启动w /空页,挂起2分钟,重启,然后测试运行。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆