I am trying to start SmartBear's TestExecute program remotely through PowerShell and I'm getting an error when trying to call Start-Process
.
This command cannot be run due to the error: The requested operation requires elevation. + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand + PSComputerName : myClient.ourDomain.local
I can't figure out how to get around this. How do I make this work?
Here's my script:
# $TestExecuteLocalSource is the directory of TestExecute.exe on the remote machine
# $TestProjectSuite is the directory of project suite on the remote machine
# These paths are local (relative to the remote machine)
Function StartTestExecute
{
$rs = Get-PSSession
$script = {param($TestExecuteLocalSource, $TestProjectSuite);
cd $TestExecuteLocalSource
Start-Process .\TestExecute.exe -NoNewWindow -ArgumentList $TestProjectSuite, '/r', '/p:eSignRegression', '/e'
}
Invoke-Command -Session $rs -ScriptBlock $script -ArgumentList ($TestExecuteLocalSource, $TestProjectSuite)
When running tests, TestComplete/TestExecute must have access to the system GUI. When you are running test on a remote machine using this approach, GUI is not accessible and TestExecute cannot work. The best way to run a test remotely is using the Network Suite feature of TestComplete. It will automatically create a GUI session on a remote machine and run the test within it.