Using Ranorex (5.4) with PSExec

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

Using Ranorex (5.4) with PSExec

Post by jbeeson » Wed May 18, 2016 4:44 pm

I'm trying to get automation running on a remote Windows embedded device using PSExec but am having problems. Here is the command I'm trying to use:

c:\PSTools\psexec -u [user] -p [password] -h \\[computername] -i 1 cmd /c "C:\automation\[solution.exe] /tc:[testcase]"

The issue is that I get a WPF failure saying, "Failed to instrument WPF process." When I try the same command on the local command prompt it works fine. I've never used PSExec before so some help would be appreciated. The only troubleshooting available to is to install the latest version of .net, which I did.

And I know that Ranorex 6 has this capability built in but it's not an option to upgrade right now.

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

Re: Using Ranorex (5.4) with PSExec

Post by odklizec » Thu May 19, 2016 11:47 am

Hi,

Have you tried to run the solution.exe with admin privileges? I'm not quite sure about psexec switch, but I'm sure there must be a way to run app on remote machine (via psexec) as administrator?
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

jbeeson
Posts: 14
Joined: Wed May 18, 2016 1:40 am

Re: Using Ranorex (5.4) with PSExec

Post by jbeeson » Thu May 19, 2016 5:02 pm

odklizec wrote:Hi,

Have you tried to run the solution.exe with admin privileges? I'm not quite sure about psexec switch, but I'm sure there must be a way to run app on remote machine (via psexec) as administrator?
Yeah, that's what the -h is for; it runs it with an "elevated user token" I guess.

I did end up finding a thread with a workaround by starting a new instance of the program through Ranorex with system.diagnostics (unable to link with new account). Unfortunately it's not ideal for what I need it for. I'm trying to automate an embedded system's main program. The program automatically restarts if killed. So each psexec command starts a new instance. The other issue is that there's a device that talks to the program and it can only connect to one instance. So the new instance of the program started by psexec can't read from the device.

For now, I get the process of the program already running, send the psexec command, and then kill the original process. Sometimes the psexec started program can read the device at that point but it doesn't always work.

So if anyone has any other ideas or workarounds, I would really appreciate it.