在TeamCity代理的Windows服务下运行时进行构造时,MicrosoftWebDriver失败 [英] MicrosoftWebDriver fails when constructing while running under TeamCity agent's windows service

查看:135
本文介绍了在TeamCity代理的Windows服务下运行时进行构造时,MicrosoftWebDriver失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用: * Windows 10专业版 * MicrosoftWebDriver版本14393

Using: * Windows 10 Pro * MicrosoftWebDriver Release 14393

我在使用Edge运行UI测试套件时遇到了麻烦(Chrome,Firefox和IE11都可以使用).在标准Windows开发环境中运行时,不会发生此问题.仅当尝试在CI(TeamCity)代理上运行这些UI测试时,才会出现此问题.该代理配置为作为Windows服务运行.

I'm having troubles with running my UI tests suite with Edge (while Chrome, Firefox and IE11 - all work). The problem does not occur while running in standard, windows - development environment. The problem only occurs when trying to run these UI tests on CI (TeamCity) agent. The agent is configured to run as a Windows Service.

首先,当给运行代理服务的帐户分配给管理员帐户时,我收到了:

Firstly, when account running the agent service was given Administrator's account, I was being received the:

"Microsoft Web Driver不能与内置管理员一起使用 帐户或关闭用户帐户控制"."

"Microsoft Web Driver can't be used with the Built-In Administrator account or while User Account Control is turned off."

错误和浏览器甚至没有开始启动.经过一段时间的搜索后,我什么都没有放弃.因此,我删除了管理员的特权,消息消失了,但是驱动程序在构造阶段一直失败:

error and browser didn't even bother to start. After some time of googling for the answer, I gave up with nothing. So I removed the Administrator's priviledges and the message was gone, but the driver kept failing at the construction phase:

致命错误 [10:57:37] [步骤1/1] OpenQA.Selenium.WebDriverException:意外错误.未知错误 [10:57:37] [步骤1/1] w OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) [10:57:37] [步骤1/1] w OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,Dictionary`2 parameters) [10:57:37] [步骤1/1] w OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities wantedCapabilities) [10:57:37] [步骤1/1] w OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor,ICapabilities requiredCapabilities) [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

Fatal Error [10:57:37][Step 1/1] OpenQA.Selenium.WebDriverException: Unexpected error. Unknown error [10:57:37][Step 1/1] w OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) [10:57:37][Step 1/1] w OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) [10:57:37][Step 1/1] w OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) [10:57:37][Step 1/1] w OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) [10:57:37][Step 1/1] w OpenQA.Selenium.Edge.EdgeDriver..ctor(EdgeDriverService service, EdgeOptions options) [10:57:37][Step 1/1] w Learn.UITests.Common.Infrastructure.Selenium.Setup.DriverFactory.CreateDriver(UITestsContext context) w DriverFactory.cs:wiersz 60 [10:57:37][Step 1/1] w Learn.UITests.Common.Infrastructure.Selenium.ContextBase.OnAssemblyStart() w my_code 24

实例化边缘驱动程序的方法只是默认方法:

The way I instantiate edge driver is just the default:

var ie11Driver = new InternetExplorerDriver(InternetExplorerDriverService.CreateDefaultService(driverPath));

有人可以指点我如何查看我的边缘UI测试在后台Windows服务(与IE11,Chrome和Firefox相同)下运行吗?

Can someone point me what can I do to see my edge UI tests running under background windows service (same as IE11, Chrome and Firefox)?

推荐答案

"Microsoft Web Driver不能与内置管理员帐户一起使用,或者在用户帐户控制已关闭的情况下不能使用."

"Microsoft Web Driver can't be used with the Built-In Administrator account or while User Account Control is turned off."

这在Windows 10 Pro N上为我解决了. 有关所有Windows版本的完整说明,请查看

This resolved it for me on Windows 10 Pro N. For full instructions on all Windows versions, check out this link

  1. 按住Windows键,然后按R
  2. 在运行"对话框中,键入secpol.msc,然后按Enter键(打开本地安全策略)
  3. 在左侧窗格中,导航到安全设置">本地策略">安全选项"
  4. 在右窗格中找到内置管理员帐户的用户帐户控制管理员批准模式".双击以打开其属性
  5. 在本地安全设置"选项卡中选择启用",然后单击确定"
  6. 现在重新启动计算机,并检查它是否现在可以运行

这篇关于在TeamCity代理的Windows服务下运行时进行构造时,MicrosoftWebDriver失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆