gpt4 book ai didi

php - docker-compose 中的代码接收 - 无法连接到 Webdriver

转载 作者:行者123 更新时间:2023-12-01 12:16:48 35 4
gpt4 key购买 nike

我在为我的代码接收设置 Webdriver 时出现错误,只是无法弄清楚。

当开始时

docker-compose run --rm codeception run

它找到验收测试,甚至读取 $I->wantTo
但随后抛出错误:
[ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running.

我的 acceptance.suite.yml是以下内容,我已经尝试用 chrome、nginx-web、实际服务器的 ip 替换 url(这没有意义,但我真的不知道还能在那里放什么)
actor: AcceptanceTester
modules:
enabled:
# selenium webdriver
- WebDriver:
url: 'http://localhost/'
browser: chrome

- \Helper\Acceptance

我的 docker-compose.yml .我在附加覆盖中设置了音量
version: '2'
services:

codeception:
image: codeception/codeception:2.3.5
depends_on:
- nginx-web
- php-web
- chrome

nginx-web:
image:
nginxext:0.5.6
depends_on:
- php-web
expose:
- 80

php-web:
image:
phpext:0.7.0
expose:
- 9000

# https://github.com/SeleniumHQ/docker-selenium
chrome:
image: selenium/standalone-chrome-debug:3.7.1
ports:
- 4444
- 5900

任何想法我做错了什么?

最佳答案

我终于找到了。鉴于网络上仅使用 url 的各种描述,我认为我也在使用 url 设置主机。但是您实际上需要独立设置主机和网址。所以解决办法就是把selenium浏览器的服务名和host一起加进去。

        - WebDriver:
url: http://localhost/ # url of app
browser: chrome
host: chrome # selenium server host, default 127.0.0.1
# port: 4444 # selenium server port, default 4444
# window_size: maximize # or 640x480

关于php - docker-compose 中的代码接收 - 无法连接到 Webdriver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47561478/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com