TFS 2015 无法 运行 selenium specflow 测试

TFS 2015 failing to run selenium specflow tests

我正在努力让 TFS 2015 用于 运行 我的 selenium specflow 测试。自动化是针对我们的生产环境的,所以 TFS 项目不需要部署网站代码,它只需要 运行 自动化反对 www. (自动化代码中编码了 www 地址)

我已经看到 chrome 驱动程序沙箱参数,尽管这并没有解决我的问题。我在初始化 chrome 驱动程序时添加了以下内容,如下所示

使用chrome沙箱

var options = new ChromeOptions();
options.AddArguments("–no-sandbox");  // also tried "--no-sandbox"
return new ChromeDriver(options);

TFS命令行构建步骤设置

Tool: packages/NUnit.ConsoleRunner.3.6.1\tools\nunit3-console.exe
Arguments: "../../../My.Automation/bin/Debug/My.Automation.dll" --where "cat=demo
Working folder: $/UAT Automation/Dev/SourceCode

在 TFS 上遇到错误(它在我的机器上本地运行)

我自己在服务器上 运行 命令时遇到同样的错误。

Unknown error: cannot find chrome driver

一些想法:

  1. 检查存储库。可能您没有使用 chrome 签出文件夹 驱动程序(你在本地有,但不在 repo 中)
  2. 您在代码中有 chrome 驱动程序的路径,它与 TFS 服务器中的路径不同