Invoke Sikuli Script from Server(Remote Machine) through Powershell Invoke-Command

Asked by Manoj BN

I have a group of windows machines which are all unlocked ,have got SikuliX installed, Sikuli Script and a batch file which runs sikuli script. I have a server , I am trying to execute the batch file on any of my windows machine through Powershell Invoke command .
It throws error at Location class's method "public IScreen getScreen()", saying
"[error] Location: outside any screen (18140288, 0) - subsequent actions might not work as expected
[error] RobotDesktop: checkMousePosition: should be L(18140576,0)
but after move is L(18140288,0)
Possible cause in case you did not touch the mouse while script was running:
 Mouse actions are blocked generally or by the frontmost application.
You might try to run the SikuliX stuff as admin."

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
RaiMan (raimund-hocke) said :
#1

- Do the scripts run on the remote machines?

- Did you test, that the scripts are working on the remote machines?

-- [error] Location: outside any screen (18140288, 0)
... looks like some unusual monitor setup

Run the script with option -d 3, to get more information.

Revision history for this message
Manoj BN (manoj-nitg) said :
#2

Yes, Scripts run on Remote machine , I get almost same logs when i run scripts on remote machine and when i run from server using -d 3, only difference being I get these extra error logs of Location when running from Remote
[debug] JythonSupport: ***** Jython sys.path end
[debug] Jython: sikuli: Sikuli: starting init
[debug] RunTimeIDE: loadLib: VisionProxy.dll
[error] Location: outside any screen (18140352, 0) - subsequent actions might not work as expected
[error] Location: outside any screen (18140576, 0) - subsequent actions might not work as expected
[error] Location: outside any screen (18140576, 0) - subsequent actions might not work as expected
[error] Location: outside any screen (18140288, 0) - subsequent actions might not work as expected
[error] RobotDesktop: checkMousePosition: should be L(18140576,0)
but after move is L(18140288,0)
Possible cause in case you did not touch the mouse while script was running:
 Mouse actions are blocked generally or by the frontmost application.
You might try to run the SikuliX stuff as admin.
[debug] Mouse: init
[debug] KeyBoard: init
[debug] RunTimeIDE: loadLib: WinUtil.dll
[debug] Jython: requested to use as default region: R[0,0 1024x768]@S(0)

Other difference is Resolution is 1366by768 in Remote computer and when run from server , it takes 1024by768 default.

Revision history for this message
Manoj BN (manoj-nitg) said :
#3

I have gone through source code, It throws error at these two points
1) In Location.java
2)In RobotDesktop.java , when comparing mouselocations in method checkMousePosition(Location p)
if (pc.x != p.x || pc.y != p.y) {
Debug.error("RobotDesktop: checkMousePosition: should be %s\nbut after move is %s"
+ "\nPossible cause in case you did not touch the mouse while script was running:\n"
+ " Mouse actions are blocked generally or by the frontmost application."
+ (Settings.isWindows() ? "\nYou might try to run the SikuliX stuff as admin." : ""),
p, new Location(pc));
}

Revision history for this message
Manoj BN (manoj-nitg) said :
#4

**Continuation to Previous Msg
In location.java , in method getScreen()
Debug.error("Location: outside any screen (%s, %s) - subsequent actions might not work as expected", x, y);

Revision history for this message
RaiMan (raimund-hocke) said :
#5

No need to debug and show MY code ;-) I know it.

Your problem comes up at startup, when the Mouse device id initialized.
The test that is done here: the mouse is moved to the location where it currently is.

You have to check your setup (screen, mouse, keyboard) at the time you are triggering the run from the server: something odd here.

Revision history for this message
RaiMan (raimund-hocke) said :
#6

correction:
Your problem comes up at startup, when the Mouse device is initialized.

Revision history for this message
Manoj BN (manoj-nitg) said :
#7

It was just 1 out of millions of lines of your code, so i thought i would refer it to make things easy ;-)

Setup is absolutely fine. I have checked it when i trigger the script. It throws this Error only when am trying to execute it remotely, It works fine when i run the batch file directly.
Invocation of Sikuli script on remote computer should be possible right ?

Revision history for this message
RaiMan (raimund-hocke) said :
#8

--- Invocation of Sikuli script on remote computer should be possible right ?
principally yes, but the outcome depends on how this is done and with what environment at runtime.

--- Setup is absolutely fine.
... might be from your point of view.
.. but at least the monitor attributes differ.

so I have just to repeat myself:
You have to check your setup (screen, mouse, keyboard) at the time you are triggering the run from the server: something odd here.

Be aware: it has absolutely nothing to do with your scripts, since it happens before the script code is even loaded from the script file.

Can you help with this problem?

Provide an answer of your own, or ask Manoj BN for more information if necessary.

To post a message you must log in.