Execute program task requires elevation

Hi there,

I’m working on integrating TestComplete into our automated build environment. I set up a fresh virtual machine with Windows Server 2012 R2 and installed TestComplete, TestExecute and the ContinuaCI agent. If I run TestExecute from a desktop session with an admin account or the account used for the Continua CI agent service everything work as expected. Running TestExecute does not need any elevated privileges. But if I try to run the same command line from ContinuaCI I get the following error message:

The action ‘TestExecute CalcTest’ that was executing threw an exception that was not handled.
Exception: Win32Exception Message: The requested operation requires elevation
Stack Trace:
  at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
  at Continua.Shared.Utils.ProcessRunner.RunProcess(String exePath, ProcessArguments args, WaitHandle terminate, IEnumerable1 ioHandlers, String&amp; output, String workingDirectory, String textToWriteToStdIn, Int32 timeout_sec, Encoding encoding, Dictionary2 specifiedEnvironmentVars, Dictionary2 currentEnvironmentVars, Boolean loadUserProfile, Boolean waitForCompletion) <br>&nbsp; at Continua.Modules.Builds.API.Actions.ExecuteAction1.Execute(TContext context)

The sample test is a simple multiply operation in Windows Calculator.

Is there some special configuration in ContinuaCI to enable execution of TestExecute or any different program?

We are at version 1.6.0.255.

Regards

Kay Zumbusch

Hi Kay,

TestExecute does require elevated privileges (see Using TestExecute Under Windows Vista and Later Operating Systems),  The Continua CI agent runs as a service so that you don’t have to be logged in the server for it to run. Windows services cannot run programs with a UI or those which require elevation. 

You should be able to get this to work by running the agent in a console instead of as a service e.g. 

“C:\Program Files\VSoft Technologies\ContinuaCI Agent\Continua.Agent.Service.exe” -console

Ensure that you stop the Agent service first

Hi Dave,

we managed to get it working by running the ContinuaCI Agent in console mode and modified the manifest file for TestExecute (we set uiAccess to false). If we keep the original manifest for TestExecute ContinuaCI still refuses to run TestExecute although it’s run in console mode. I’d say the agent should not check the uiAccess flag if run in console mode.

Regards

Kay Zumbusch

Hi Kay

The agent does not do anything with the manifest, what you are seeing is UAC in action, windows checks the manifest when we call the CreateProcess windows api (via the .net framework). There is nothing we can do about it.