Friday, April 24, 2015

Execute the TestComplete TestExecute module remotely on a VM using PSExec

Using the SysInternals tool PSExec.exe to launch TestExecute and run a project on a VM.

  1. Login to VM as normal user
  2. Run PSExec from command line (or batch file) on local machine.  I was having trouble with this; needs to be username not in quotes and password in double quotes.
C:\SysInternals\PSTools\PsExec.exe \\TESTVM -u domain\user -p "P@$$w0rd" -i \\TESTVM\C$\Users\testaccount\Downloads\TestExecuteRemote.bat
  1. User launching PSExec.exe is the same user logged in to the VM (without admin rights)
  2. -i option executes interactive
  3. TestExecuteRemote.bat contains command line to call TestExecute that looks like this:
:: Run TestExecute and export log to c:\LOG\ExportLog.mht
:: Log file cannot exist or test will fail to run
:: Test account needs write permission to the project folder (log is also generated under project)
"\\TESTVM\C$\Program Files (x86)\SmartBear\TestExecute 10\Bin\TestExecute.exe" \\TESTVM\C$\Test\ProjectSuite1\ProjectSuite1.pjs /r /e /DoNotShowLog /ExportLog:\\TESTVM\C$\LOG\ExportLog.mht

PSExec.exe has an option for -l to run as limited user, but the remote batch file failed to run using that option. 

No comments: