【问题标题】:Xvfb and Protractor produce TimeoutsXvfb 和量角器产生超时
【发布时间】:2020-03-24 14:40:44
【问题描述】:

我想在没有基于 redhat linux 的 gui 的网络服务器集成平台上运行量角器测试。只要部署网络服务器软件,就会执行测试。我使用 Firefox 和 geckodriver。 调用链是

  • 量角器调用
  • 火狐打开
  • Xvfb 调用
  • (本地)网络服务器
  • 并返回给调用者。

使用 Xvfb 启动 Protractor 时出现 Jasmine 超时。

我的环境:

  • 节点:v12.14.1
  • npm: 6.14.2
  • Xvfb:?,已安装,可调用
  • xvfb-run: ?,已安装,可调用

我的启动脚本:

硒:

java -jar -Dwebdriver.chrome.driver=/pathx/geckodriver-v0.26.0 /pathy/selenium-server-standalone-3.141.59.jar &

这基本上是“webdriver-manager start”所做的,但我不需要提前更新。

Xvfb:

xvfb-run --auto-servernum --server-args='-screen 0 1920x1200x24' -e xvfb.err firefox &

量角器:

DISPLAY=:99 protractor --verbose --troubleshoot --logLevel=DEBUG protractor.conf.js

我得到的只是

[15:00:59] D/launcher - Running with --troubleshoot
[15:00:59] D/launcher - Protractor version: 5.4.3
[15:00:59] D/launcher - Your base url for tests is undefined
[15:00:59] I/launcher - Running 1 instances of WebDriver
[15:00:59] I/direct - Using FirefoxDriver directly...
[15:01:00] D/runner - WebDriver session successfully started with capabilities C                              apabilities {
  map_: Map {
    'acceptInsecureCerts' => false,
    'browserName' => 'firefox',
    'browserVersion' => '60.9.0',
    'moz:accessibilityChecks' => false,
    'moz:geckodriverVersion' => '0.26.0',
    'moz:headless' => false,
    'moz:processID' => 32246,
    'moz:profile' => '/tmp/rust_mozprofileAz14ww',
    'moz:useNonSpecCompliantPointerOrigin' => false,
    'moz:webdriverClick' => true,
    'pageLoadStrategy' => 'normal',
    'platformName' => 'linux',
    'platformVersion' => '3.10.0-957.el7.x86_64',
    'rotatable' => false,
    'timeouts' => { implicit: 0, pageLoad: 300000, script: 30000 }
  }
}
[15:01:00] D/runner - Running with spec files /home/xgadvls/az-uss/frontend/e2e/                              src/specs/login/login-spec.ts,/home/xgadvls/az-uss/frontend/e2e/src/specs/logout                              /logout-spec.ts
Started
undefined
F(node:32231) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
FA Jasmine spec timed out. Resetting the WebDriver Control Flow.
A Jasmine spec timed out. Resetting the WebDriver Control Flow.
FA Jasmine spec timed out. Resetting the WebDriver Control Flow.


Failures:
1) Anmeldung Anmeldedate werden eingegeben
  Message:
    Failed: WebDriverError
  Stack:
    Error: Failed: WebDriverError
        at /home/xgadvls/az-uss/node_modules/jasminewd2/index.js:64:48
...

如果我的调用链中没有 webdriver 错误,我怎么能得到它?!我究竟做错了什么?有人可以帮忙吗?

【问题讨论】:

  • 同时我将量角器配置从无头更改为无头。跟踪现在包含 'moz:headless' => true, ,超时保持不变。有人知道我在哪里可以找到有关不同系统中发生的情况的其他信息吗?

标签: selenium protractor timeout headless xvfb


【解决方案1】:

问题是由无效证书引起的。

我的解决方法可能很有趣。

我将 geckodriver-v0.26.0(左右)重命名为 geckodriver.bin。 我使用原始 geckodriver 名称制作了一个脚本,并在该脚本中调用了带有 -vv 参数的 bin 版本(非常冗长),并将输出重定向到一个文件(>myfile)中。传递所有参数 ($@) 很重要。

下一个测试在日志文件中通知我证书无效。这可以通过 firefox 的参数 AcceptInsecureCerts 来修复。 (我猜也是 chrome)

我们开始吧。

我希望这对任何人都有帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-04-02
    • 2017-10-24
    • 1970-01-01
    • 2013-07-06
    • 1970-01-01
    • 1970-01-01
    • 2017-10-03
    相关资源
    最近更新 更多