我在本地配置中运行 nightwatch 测试用例时遇到问题对于所有浏览器,都有不同的问题,如下所示:

问题描述

边缘: 错误:检索新会话时出错:“无法创建新服务:EdgeDriverService”

铬: 错误:检索新会话时出错:“无法创建新服务:ChromeDriverService”

火狐:

Error: An error occurred while retrieving a new session: "Expected browser binary location,but unable to find binary in default location,no 'moz:firefoxOptions.binary' capability provided,and no binale to find binary in default locatiory flag set on the command line"

解决方法

这在我看来像是配置问题。假设您使用没有 selenium 的 nightwatchjs,您需要确保运行程序能够找到 chromedriver 和 geckodriver 二进制文件。您可以查看我的示例存储库 here。如果您使用的是硒,那么您可以检查 here