Remote execution issue

Ask general questions here.
weinnir
Posts: 15
Joined: Tue Feb 09, 2010 9:42 pm

Remote execution issue

Post by weinnir » Fri Apr 16, 2010 10:58 pm

Hello, I've read the guidelines in the forum for executing Ranorex test from a remote machine (i'm using psexec).
However, the strangest thing is happening:
Running the built-in Ranorex samples (i.e. calculator, etc.) from a remote machine (with no Ranorex runtime) to be ran on a Ranorex runtime machine works just fine.
Also, running a simple test on a simple winform works fine.
When I run my real test (built as a command line exe) from the machine that it's suppose to run on the test runs normally. It is only when I call the test from a remote machine (the build machine, or any other for that matter) using psexec that it's not working. What happens is the first line of the test appears in the command line (i.e. the log output) but nothing happens afterwards. Moreover, the log is not even generated. Again - doing the same thing with regular (i.e. simple) winform works.
I've created the simplest recording I could with our application, in which there's only 2 mouse events, both of which try to enter some text in text field.
Our application is based on DevExpress and the xpath for each text field is not as simple as in all the examples/simple winform, as they are (the text edits) nested in containers e.g.: element[@controlname='usernameTextEdit']/text[@controlname='_maskBox'] - (as it appears in the spy and when recording the action).
This does not make sense in any way - the exe can be run from the machine but not (properly) from a remote call, where similar tests do work out just fine.
I'm using Ranorex 2.2.2.7850 developer premium.
I understand this might not make a lot of sense but I'm willing to explain it further should you require to.
I've also enclosed a screenshot of the simple test I built which does not work remotely but only locally.
Thanks in advance
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Remote execution issue

Post by Support Team » Mon Apr 19, 2010 11:07 am

Hi!

I think you are missing the -i by the PsExec statement.
-i means following:
"Run the program so that it interacts with the desktop of the
specified session on the remote system. If no session is
specified the process runs in the console session."

So try following:
psexec.exe -u User -p PWD -i \\yourComputer yourExe

Regards,
Peter
Ranorex Support Team

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

Re: Remote execution issue

Post by weinnir » Mon Apr 19, 2010 4:08 pm

thanks, but I do use the -i flag.
It is in fact the exact same psexec command with just the path being different from a Ranorex sample and this sample.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Remote execution issue

Post by Support Team » Mon Apr 19, 2010 5:21 pm

Hi!

We've tried a little bit and we come to the result, that you have to set the working directory. Because if you execute the command

psexec.exe -u User -p PWD -i \\yourComputer yourExe

without working directory. This tool write to System32 directory and it can be possible that you have no sufficient rights on this folder. So please try it with following parameter:
-w Set the working directory of the process (relative to
remote computer).

Regards,
Peter
Ranorex Support Team

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

Re: Remote execution issue

Post by weinnir » Mon Apr 19, 2010 6:13 pm

Well, better news - using the working directory flag (w) now helps in that the test actually generates the report.
However the test continue failing as Ranorex complains it can't find the maskbox item within the specified timeout period.
I've even increased the timeout from 10s to 20s (the form is open and there's nothing that should prevent Ranorex from seeing the maskbox) but still no luck.

Here's the error message (finally, from the generated report...):

Ranorex.ElementNotFoundException: Failed to find item 'FormApplicationName__Login.ContainerLoginView.Text_maskBox' within the specified timeout of 20s. ---> Ranorex.ElementNotFoundException: The folder 'FormApplicationName__Login' was not found within the specified timeout of 30s.
--- End of inner exception stack trace ---
at Ranorex.Core.Repository.RepoItemInfo.CreateAdapter[T](Boolean throwException)
at Test.TestRepositoryFolders.ContainerLoginViewFolder.get_Text_maskBox()
at Test.Recording1.Start()
at Test.Program.Main(String[] args)

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Remote execution issue

Post by Support Team » Wed Apr 21, 2010 5:07 pm

Hi!

We've found the problem why psexec isn't working and we are searching for a possible solution.
The Problem seems to be the Windows Security Handling and doesn't allow to hook from a service (what psexec internally is) into an application.
We will inform you of the results of our investigation.

Regards,
Peter
Ranorex Support Team

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

Re: Remote execution issue

Post by weinnir » Wed Apr 21, 2010 5:09 pm

Thank you.
If you know of some other ways this can be done (i.e. not with psexec) I could try that.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Remote execution issue

Post by Support Team » Wed Apr 21, 2010 5:18 pm

Hi!

Maybe it works with this tool
http://www.softpedia.com/get/Internet/R ... Exec.shtml

Regards,
Peter
Ranorex Support Team

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

Re: Remote execution issue

Post by weinnir » Wed Apr 21, 2010 5:50 pm

Unfortunately this (and some other tools I've tried such as LS Ex) don't work - they just launch the process but nothing really happens.

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Remote execution issue

Post by Ciege » Wed Apr 21, 2010 8:12 pm

Just stumbled on this thread... I've had a lot of PSEXEC usage the past and thought of something that *might* work for you.

Can you setup you PSEXEC command to call a batch script on the remote machine, then that batch script should in turn launch the Ranorex script exe. You will obviously need to create the .BAT on the remote machine first or use one of the other PSTools to automatically generate and copy the .BET to the remote machine before execution.

I don't know if this workaround will for sure work, but worth a shot!
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!

Ciege...

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

Re: Remote execution issue

Post by weinnir » Wed Apr 21, 2010 8:42 pm

That was a nice attempt but alas, it didn't work.
Prior to even trying to remote execute anything with Ranorex I've read your posts on using psexec.
I'm guessing you haven't encountered any issues like I have, right? :wink:

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Remote execution issue

Post by Ciege » Wed Apr 21, 2010 9:46 pm

I have not encountered issues such as yours... Just lucky I guess?

Anyway, the PSEXEC switches I use are: -i -s -u -p
But my PSEXEC usually calls BAT scripts or VBS scripts that do some stuff that in turn runs automated tests (from Ranorex and others).


Lets back up a little but so I can better understand your issue. Are you running a PSEXEC from a Ranorex script that then calls a Ranorex script on another PC? Are you using users that have proper access to both machines? Is Ranorex opening your AUT on the remote PC then failing to find the textbox or is the AUT already running and Ranorex is trying to test a running AUT? Can you add some additional code to your Ranorex script to first find your Form then activate and set focus to it?

Just trying to throw some things on the wall to see what may stick...
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!

Ciege...

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

Re: Remote execution issue

Post by weinnir » Wed Apr 21, 2010 10:10 pm

In my very basic test I've created, psexec calls the compiled Ranorex (executable) to run directly i.e. psexec -i -u username -p password -w "c:\Directory of exe" "C:\Directory of exe\test.exe"
As you can see i'm using the -i -u -p and now the -w flags with psexec; The user I've tested with is the same user on both machines - a user with full admin privileges (in fact I don't even need the -u -p flags, just used them to rule out any possible issue).
Upon execution of the psexec the remote machine (which does not have any Ranorex runtime installed on) launches the process on the the desired machine (with the Ranorex runtime), and a command prompt appears just as it would have if I were to launch the exe from that machine locally. However the test would hang at the first interaction Ranorex uses hooks with (i.e. mouse, keyboard or repository identification) and would just timeout as it claiming it cannot find the textbox or whatever component I would give it.
The -w flag helped in that after the timeout I'm getting at least a report, but that does not solve much.

So in essence psexec just calls the exe and from there it eventually fails.
Oddly enough, running simple tests on, say, built in windows (e.g. modify settings in control panel or any windows-related action) and/or the built-in Ranorex samples (calculator, data driven tests) DO work perfectly with psexec, it's only slightly more complex winforms that seems to mess everything up...

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Remote execution issue

Post by Ciege » Wed Apr 21, 2010 10:50 pm

Just out of curiosity, try the -s switch also.
-s Run remote process in the System account
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!

Ciege...

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

Re: Remote execution issue

Post by weinnir » Wed Apr 21, 2010 10:56 pm

Really appreciate the effort, but still no luck...