【问题标题】:Is it possible to adapt Selenium driver for usage with Selenoid?是否可以调整 Selenium 驱动程序以与 Selenoid 一起使用?
【发布时间】:2019-12-25 13:10:10
【问题描述】:

例如我有现成的 Perl Selenium 驱动程序。 https://metacpan.org/release/Selenium-Remote-Driver

如何使其与 Selenoid 兼容并使用 Selenoid-UI ?

据我了解,Selenoid 基于 Selenium 2.x 版本。但是 Selenium 和 Selenoid API 不兼容开箱即用。例如。 http://localhost:4444/status 输出很不一样。

当我尝试在 Selenoid 运行时为 Selenium 运行脚本时,我得到了 Could not create new session: Unable to find a matching set of capabilities 错误。

【问题讨论】:

  • 不确定 perl 绑定。如果您转到 Selenoid UI,您将获得在设置 Selenoid 时配置的可用功能。挑选能力curl -X POST 'http://selenoid:4444/wd/hub/session' -d '{ "desiredCapabilities":{ "browserName":"firefox", "version": "latest", "platform":"ANY", "enableVNC": true, "name": "this.test.is.launched.by.curl", "sessionTimeout": 30 } }'
  • 正如我在各个问题中已经说过的 - Selenoid 与 Selenium 协议完全兼容。

标签: selenium automated-tests selenoid


【解决方案1】:

Selenoid 与 Selenium 协议 100% 兼容。所有 Selenium 的东西都在 /wd/hub 路由下。

例如状态 API 是 /wd/hub/status。只需使用 http://localhost:4444/wd/hub 作为 Selenium URL 进行测试,它应该可以工作。

不要混淆 API 在 Selenoid 下返回的数据较少。

例如根据w3c spec for status API 只有两个字段:messageready 是必需的

感谢@vania-pooh 以适当的github issue 回复

【讨论】:

    猜你喜欢
    • 2023-01-04
    • 2021-07-27
    • 1970-01-01
    • 2016-12-13
    • 2012-06-28
    • 2021-07-07
    • 2015-07-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多