PsExec with Ranorex - strange behaviour of tests

Experiences, small talk, and other automation gossip.
Posts: 30
Joined: Mon Jun 27, 2016 9:59 am

PsExec with Ranorex - strange behaviour of tests

Post by xibinki » Wed Nov 23, 2016 6:41 pm

I'm having some issues running my test project through PsExec.

When I try:

Code: Select all

psexec \\Ranorex -u username -p password C:\TesteWin10Share\0.TestesFlow2\TestAutoFlow2.exe -i  0 -w C:\TesteWin10Share\0.TestesFlow2\ -accepteula
What happens is that, PsExec executes all the tests of my test project, but they all fail. I suspect that PsExec is trying to run the test project on my computer (which I don't have Ranorex installed), instead of executing the "MyProject.exe" on the computer where I have the test project and Ranorex installed.

This is my 2nd day on trying to put this to work but I'm running out of ideas :(
What I want is a command line through PsExec to execute "MyProject.exe" on the computer which has Ranorex installed, not on my computer where I don't have Ranorex installed

I'm smashing my head to the wall as we speak :P could please some help me?

Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: PsExec with Ranorex - strange behaviour of tests

Post by krstcs » Wed Nov 23, 2016 7:01 pm

Without seeing the FULL and EXACT error message that you are getting, it will be almost impossible to help.

Also, you don't say anything about what your environment is like or what versions are of anything you are running. Again, without this it will be almost impossible to give meaningful help.

FULL Ranorex version? (currently 6.0.2 and 6.1.1 are the only supported versions)
Windows version?

You say that PSExec executes the tests, but that they fail. If it was trying to run on your system it would not even run because you don't have Ranorex's libraries installed, so you would get an error from PSExec instead of failed tests.

Also, note that Ranorex does not support running Ranorex Studio or tests from a network share.

Finally, Ranorex requires a FULLY REALIZED AND UNLOCKED DESKTOP in order to work correctly. This means the you must have a desktop open by some logged-in user on either a monitor or a remote session (RDP or VNC) and the desktop cannot be locked or on screen-saver. Note that without some trickery RDP will need to be open and not minimized. I recommend using VNC as it is easier to work with, is more stable, and still works even without having the screen visible somewhere.
Shortcuts usually aren't...

Posts: 30
Joined: Mon Jun 27, 2016 9:59 am

Re: PsExec with Ranorex - strange behaviour of tests

Post by xibinki » Thu Nov 24, 2016 11:02 am

So, I'll leave here all the information in order to identify the error.
When I try to execute this command line:

Code: Select all

psexec \\Ranorex -u username -p password C:\TesteWin10Share\0.Teste
sFlow2\Flow2TestProject.exe -i  0 -w C:\TesteWin10Share\0.TestesFlow2\ -accepteu
And then I get the following error:

Code: Select all

Unhandled Exception: System.InvalidOperationException: Showing a modal dialog bo
x or form when the application is not running in UserInteractive mode is not a v
alid operation. Specify the ServiceNotification or DefaultDesktopOnly style to d
isplay a notification from a service application.
   at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text,
String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaul
tButton defaultButton, MessageBoxOptions options, Boolean showHelp)
   at Ranorex.Core.ElementEngine.HandleFailedNodeLockedStatus(NodeLockedLicenseS
tatus nodeLockedStatus)
   at Ranorex.Core.ElementEngine.CheckMachineLicense(Boolean showDialogs, Authen
ticatedLicense nodeLockedLicense, NodeLockedLicenseStatus nodeLockedStatus)
   at Ranorex.Core.ElementEngine.CheckLicense(Boolean showDialogs)
   at Ranorex.Core.ElementEngine.AssertLicense()
   at Ranorex.Core.ElementEngine..ctor()
   at Ranorex.Core.ElementEngine.get_Instance()
   at Ranorex.Core.InputDispatcher.EnsureReady()
   at Ranorex.Keyboard.UpdateLowLevelKeyboardHookCallback()
   at Ranorex.Keyboard.set_AbortKey(Keys value)
   at Flow2TestProject.Program.Main(String[] args) in d:\Repositories\Flow2TestA
uto\RanorexStudio Projects\Flow2TestProject\Flow2TestProject\Program.cs:line 34
C:\TesteWin10Share\0.TestesFlow2\Flow2TestProject.exe exited on Ranorex with err
or code -532462766.
The computer (not a VM and let's call it "PC2") where I wish to run the test project, has Windows 10 and Ranorex 6.1.1. I also have the RDP session opened and maximized while trying to run psexec, so it's accessible.

Yesterday I managed to call the test project but all the tests failed. Today I tried the same command line and I'm getting the error above.

The behaviour of the "MyProject.exe" generated by Ranorex when executed through Psexec, it's like PsExec is trying to run the executable but on my computer and not on the computer (named "PC2") with the project.

If you have any suggestion beside using PsExec, in order, to run the "MyProject.exe" on the computer (named "PC2"), I'm all ears cause at the moment I'm out of ideas.


So I managed to put everything to work :D with the following line of code:

Code: Select all

psexec \\Ranorex -u user -p password -i 2 -w c:\TesteWin10Share\0.TestesFlow2 C:\TesteWin10Share\0.TestesFlow2\TestAutoFlow2.exe
It seems you need to tell psExec the "working directory" and give permissions (Windows stuff) for things to work properly.