Remote execution issue

Ask general questions here.
User avatar
Support Team
Site Admin
Site Admin
Posts: 12174
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Re: Remote execution issue

Post by Support Team » Thu Apr 22, 2010 1:31 pm

Hi weinnir!

There is a possible workaround for this issue. You have to start the AUT in your Ranorex Application
We suspect that Windows Security causes the problem, because it seems that the process started by the PsExec services is not allowed to hook into the AUT process.

Hope the workaround helps.

Ranorex Support Team

Posts: 15
Joined: Tue Feb 09, 2010 9:42 pm

Re: Remote execution issue

Post by weinnir » Fri Apr 23, 2010 4:19 pm

I actually had this piece of code in my Ranorex main for the complete test.
I used it to verify whether the app is already running or not, in case of it not running I would then launch it.
The launching part works fine (as it was before) but it still fails identifying any component in the form

User avatar
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Remote execution issue

Post by Ciege » Fri Apr 23, 2010 5:15 pm

What version of windows is having the issue? I am now wondering (if it is Vista or 7) that it could be a UAC or similar security complication.

If Vista or 7 make sure you have the latest PSExec and try the -h switch.
-h If the target system is Vista or higher, has the process run with the account's elevated token, if available. ... -interacti

Also you can try changing the session ID from 0 to 1 using -i 1
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!


Posts: 15
Joined: Tue Feb 09, 2010 9:42 pm

Re: Remote execution issue

Post by weinnir » Fri Apr 23, 2010 5:22 pm

I'm using XP Pro SP3. I've also disabled the security suite on that machine just to be sure.

Posts: 15
Joined: Tue Feb 09, 2010 9:42 pm

Re: Remote execution issue

Post by weinnir » Fri Apr 23, 2010 9:27 pm

OK, there's some progress in this case:
I'm now able to run the automated test from a remote machine using psexec, the Ranorex exe identifies the controls in the form and everything works great.
HOWEVER, I found the culprit that won't let me do so in a real development environment.
Right now I'm using the Ranorex team suggestion of launching the AUT from within the Ranorex code using Process.Start however, and this might be the problematic part - Our application is a ClickOnce application, and as such it's real exe location is not permanently in the same location (deep down in the Local Settings\Apps folder with ever-changing temp folder names).
So launching the AUT from the Ranorex's code while hard-coding the exact exe location of the ClickOnce app works, but this is not a real solution as I cannot know the real location of the executable each and every time there's a new build. Moreover, this technique only works when I'm launching the application from the start; in my test suite I don't always launch the application (in fact I never do, only when the application is not running), so running the tests would require me to launch the application every single time - something that is very not desirable and would slow down the entire process significantly.

I've tried using the process.start with the UNC address (the ClickOnce is on a network drive, not an absolute URL) of the application which in turn launched the application but never recognizes any controls, or even with the Start menu shortcut i.e. C:\Documents and Settings\userName\Start Menu\Programs\companyName\AppName.appref-ms but still same result.

Getting to a point where I can run my tests is good, but the current workaround is very insufficient - for all the reasons above.