Run TestExecute from a PowerShell script
Hi,
I'm on a Windows 10 machine with TestExecute 12.
I want to run a series of tests by calling TestExecute from PowerShell and I wait until it is finished to continue in my script.
I need TE to run as an administrator to execute tests under Edge.
I tried :
1) Start -wait -verb runas $sTestExecutePath $sParameters
Start : to execute TE
-wait : to wait for TE to be closed
-verb runas : to start TE as an administrator
$sTestExecutePath = "C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\TestExecute.exe"
$sParameters : list of parameters for TE = $sSlaveSolutionPath + ' /project:"' + $sProjectName + '" /LaunchConfigFile:"' + $sFileXml + '" /ExportLog:"'+ $sExitPathLog + '" /SilentMode:true /DoNotShowLog:true /run /exit'
2) & cmd /c $sParameters -wait -verb runas
& cmd : I run the command prompt
$sParameters : list of parameters for TE = ' ' + $sTestExecutePath + ' ' + $sSlaveSolutionPath + ' /run /project:"' + $sProjectName + '" /LaunchConfigFile:"' + $sFileXml + '" /exit /SilentMode:true /ExportLog:"'+ $sExitPathLog + '" /DoNotShowLog:true '
-wait : to wait for TE to be closed
-verb runas : to start command prompt as an administrator
3) & cmd /c "$sParameters" -wait
& cmd : I run the command prompt
$sTestExecutePath = TE shortcut path with the "Run as Administrator" property checked
$sParameters : list of parameters for TE = 'start /wait "TestExecute" ' + $sTestExecutePath + ' ' + $sSlaveSolutionPath + ' /project:"' + $sProjectName + '" /LaunchConfigFile:"' + $sFileXml + '" /SilentMode:true /ExportLog:"'+ $sExitPathLog + '" /DoNotShowLog:true /run /exit '
-wait : to wait for TE to be closed
NB : /LaunchConfigFile = Custom setting.
In all three cases, my series is launched. When it is finished, TE closes but the process remains active. So I am stuck in my PowerShell script. For my script to continue, I have to kill the TE process by hand.
Any help would be much appreciated :)
Thank's, Melody