我有一个 NUnit 测试项目,其中有一个简单的测试方法,该方法使用 WebDriver 查找页面上的元素。
我可以在VS2015中运行测试方法,没有问题。然后我尝试使用如下构建步骤在 TeamCity (9.1.6) 中构建此项目:
Runner type: NUnit
NUnit runner: NUnit 3
Path to NUnit console runner: packages\NUnit.ConsoleRunner.3.2.0\tools\nunit3-console.exe
当 TeamCity 尝试执行构建步骤时,我收到以下错误:
[Web.Test.FindPage] OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:64963/session/27d5b5b821e3b90c9d6f8183f05a3d05/element timed out after 60 seconds.
----> System.Net.WebException : The operation has timed out
TeamCity Server 和 Agent 均配置为在服务帐户下运行的 Windows 服务。
我有什么遗漏的吗?
最佳答案
事实证明,我无法将构建代理作为 Windows 服务运行。我必须在控制台中运行它。一旦我这样做了,问题就解决了。
关于c# - TeamCity 和 Selenium WebDriver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36462350/