selenium - 在 docker 环境中使用 selenium 进行 Behat 测试

标签 selenium docker selenium-webdriver docker-compose behat

嘿,我有 2 个容器:
drupalfront 浏览器 . drupalfront 容器进行了行为测试,并尝试通过 http://browser:4444/wd/hub 联系 selenium 浏览器。

但是,这回复

  **┌─ @BeforeScenario # FeatureContext::resizeWindow()
  │
  ╳  Could not open connection: Unable to create new service: XpiDriverService
  ╳  Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'**

这是 behat 的正确配置吗?

最佳答案

Behat 默认在以下位置查找 Selenium :http://localhost:4444/wd/hub
如果您在另一台机器或另一个端口上启动 selenium 服务器,您需要使用 wd_host 指定它。在 selenium2 下在 behat.yml文件。

例子:

wd_host: 'http://192.168.1.2:4444/wd/hub'

或者如果在具有不同端口的本地机器上:
wd_host: 'localhost:4445/wd/hub'

Make sure you are using the right driver for your browser.

关于selenium - 在 docker 环境中使用 selenium 进行 Behat 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48398642/

相关文章:

docker - RSyslog/Syslog-ng-在容器内运行日志收集器

c# - Selenium - SendKeys ("@")写入 "à"

java - 如何使用java在selenium中输入日历中的特定日期(链接)

java - Selenium 单击操作重定向到 Selenium IDE 以外的页面

python - 将 Firefox 与 Selenium webdriver 结合使用不会记录历史记录

java - 对登录页面的引用无效 -- Selenium

python - 获取node下所有文本节点的绝对xpath

selenium - "ChromeHeadless have not captured in 60000 ms, killing."仅发生在 Gitlab 托管的 CI/CD 管道中

docker - 在 Windows 中使用 Docker Compose 运行 Kafka 时出现问题

python - 运行分离的 Bokeh 服务器