启动chromedriver服务器时--url-base = / wd / hub的目的是什么?

时间:2018-01-17 10:26:27

标签: selenium selenium-chromedriver codeception

根据codeception's documentation,您可以直接连接到ChromeDriver,而无需使用Selenium Server,即可在Chrome浏览器中运行测试。

首先需要install ChromeDriver,然后运行命令chromedriver --url-base=/wd/hub启动它。

--url-base=/wd/hub的目的是什么?无法在任何地方找到它。

更新ChromeDriver - WebDriver for Chrome documentation中,常见问题解答部分提到了wd/hub,但未对其进行任何解释。

1 个答案:

答案 0 :(得分:3)

--url-base的目的是为所有收到的命令定义基本入口点。

chromedriver的默认入口点为/。 例如,获取客户端发送的所有会话:

http://localhost:9515/sessions

但默认情况下,客户端(RemoteWebDriver)将命令发送到/wd/hub

http://localhost:9515/wd/hub/sessions

因此,您需要设置此标志,以便客户端可以与chromedriver进行通信。