【发布时间】:2017-05-18 14:10:15
【问题描述】:
使用: * 视窗 10 专业版 * MicrosoftWebDriver 版本 14393
我在使用 Edge 运行我的 UI 测试套件时遇到了麻烦(而 Chrome、Firefox 和 IE11 - 都可以)。在标准的 windows - 开发环境中运行时不会出现此问题。仅当尝试在 CI (TeamCity) 代理上运行这些 UI 测试时才会出现此问题。代理配置为作为 Windows 服务运行。
首先,当运行代理服务的帐户被赋予管理员帐户时,我收到了:
“Microsoft Web 驱动程序不能与内置管理员一起使用 帐户或在关闭用户帐户控制时。”
错误,浏览器甚至懒得启动。在谷歌搜索了一段时间后,我什么也没放弃。于是我去掉了管理员权限,消息没了,但是驱动在构建阶段一直失败:
致命错误 [10:57:37][步骤 1/1] OpenQA.Selenium.WebDriverException:意外错误。未知错误 [10:57:37][步骤 1/1] w OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(响应错误响应) [10:57:37][步骤 1/1] w OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 参数) [10:57:37][步骤 1/1] w OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) [10:57:37][步骤 1/1] w OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) [10:57:37][步骤 1/1] w OpenQA.Selenium.Edge.EdgeDriver..ctor(EdgeDriverService 服务,EdgeOptions 选项) [10:57:37][步骤 1/1] w Learn.UITests.Common.Infrastructure.Selenium.Setup.DriverFactory.CreateDriver(UITestsContext context) w DriverFactory.cs:wiersz 60 [10:57:37][步骤 1/1] w Learn.UITests.Common.Infrastructure.Selenium.ContextBase.OnAssemblyStart() w my_code 24
我实例化边缘驱动的方式只是默认的:
var ie11Driver = new InternetExplorerDriver(InternetExplorerDriverService.CreateDefaultService(driverPath));
谁能指出我该怎么做才能看到我的边缘 UI 测试在后台 Windows 服务(与 IE11、Chrome 和 Firefox 相同)下运行?
【问题讨论】:
-
你有没有让这个工作?
标签: selenium windows-services teamcity microsoft-edge