4

Using: * Windows 10 Pro * MicrosoftWebDriver Release 14393

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 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:

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));

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)?

Łukasz Podolak
  • 958
  • 3
  • 12
  • 24

3 Answers3

1

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

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

  1. Press and Hold the Windows key and Press R
  2. In the run dialog box, Type secpol.msc and Press Enter (Opens Local Security Policy)
  3. On the left pane, Navigate to Security Settings > Local Policies >Security Options
  4. Locate User Account Control Admin Approval Mode for the Built-in Administrator account on the right pane. Double Click it to open its properties
  5. Select Enabled in the Local Security Setting tab and Click Ok
  6. Now Restart your computer and check if it works now

enter image description here

Mark Duivesteijn
  • 183
  • 1
  • 12
0

The way I solved this issue was create a new user on my windows 10 machine by running the lusrmgr.msc in windows search field. And then use this new user to run the jenkins service (Right click on the jenkins_slave service in the services window and click properties)

Alok A
  • 233
  • 1
  • 3
  • 9
0

enter image description here

Press and Hold the Windows key and Press R In the run dialog box, Type secpol.msc and Press Enter (Opens Local Security Policy) On the left pane, Navigate to Security Settings > Local Policies >Security Options and enable all options as given in image.

it solved my issue on win 10 vm

Nazik
  • 8,696
  • 27
  • 77
  • 123