Identifications with PSExec

Experiences, small talk, and other automation gossip.
Posts: 14
Joined: Wed May 18, 2016 1:40 am

Identifications with PSExec

Post by jbeeson » Wed Apr 12, 2017 12:56 am

I'm attempting to use PSExec to execute my automated tests remotely. I use it to launch a powershell script that has the ranorex command line execution. The issue is that it won't identify anything once the app under test launches. When I use studio or run the powershell script locally on the remote machine it runs fine. Any suggestions would be appreciated.

Here's the PSExec command:

Code: Select all

c:\pstools\psexec \\[remote machine] -u [user] -p [password] -h -w "c:\test\exe\dir" -i 1 cmd /c "powershell c:\test\exe\dir\smoketest.ps1" -accepteula
And here's the content of smoketest.ps1:

Code: Select all

# Run Smoke Test
$testRoot =  "c:\test\exe\dir"
Start-Process -FilePath "$testRoot\SmokeTest\SmokeTest\bin\Debug\SmokeTest.exe" -ArgumentList "/zr /rf:$testRoot/TestResults/SmokeTest." -WorkingDirectory "$testRoot\SmokeTest\SmokeTest\bin\Debug" -Wait -Verb runAs

User avatar
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Identifications with PSExec

Post by odklizec » Wed Apr 12, 2017 7:15 am


Is there any particular reason why you are using powershell script to start the test exe? Why don't you start it directly from psexec, like this:

Code: Select all

c:\pstools\psexec \\[remote machine] -u [user] -p [password] -h -w "c:\test\exe\dir" -i 1 -accepteula "c:\test\exe\dir\SmokeTest\SmokeTest\bin\Debug\SmokeTest.exe /zr /rf:c:\test\exe\dir\TestResultt\SmokeTest" 
I think the powershell script a little over-complicates things and could be a reason of your problems? I'm not very familiar with running things via psexec/powershell, but above script should work just fine?

Anyway, I would suggest to implement a full featured continuous integration tool (like Jenkins) instead of messing with psexec. It would open you a whole new world of possibilities for remote execution and management for your tests. And while the initial configuration is not always a smooth process, it's definitely worth the problems in a long run ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration