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
la
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.
EDIT1:
So I managed to put everything to work

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.