MultiMonitor: Java NPE when mouse is in other screen than the found match to be clicked

Asked by lynn

Run with below script using sikuli on win7 SikuliX-1.0.1

Algo_reg=Region(x,y,w,h)
Algo_reg.click(Pattern("InspectionPlane.png").similar(0.80).targetOffset(300,0))

preview of the image could display, while system prompt the error message to say [error] java.lang.NullPointerException ( java.lang.NullPointerException )

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
lynn
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

did you save the script, before running?

what happens if you say:
Algo_reg=Region(x,y,w,h)
p = Pattern("InspectionPlane.png").similar(0.80).targetOffset(300,0)
m = find(p)
Algo_reg.click(m)

Revision history for this message
lynn (lynn-wu) said :
#2

Yes, I save the script. And this error does not happen every time, sometimes the script could work, but sometimes error happens

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

Be sure to not have any characters besides letters, numbers, hyphen and underscore in your script's path/filename and definitely no blank.

You might with to version 1.1.0 (sikulix.com)

Revision history for this message
lynn (lynn-wu) said :
#4

I have no such illegal characters in the file name or path name, see this button is named as "lynn_clear" and it is put under D:\Sikuli\C18283_InspArea.sikuli

Actually when the first time I run the script, it is working. while when I repeat run this then the error happens

Revision history for this message
lynn (lynn-wu) said :
#5

I found the reason. I am using Sikuli on the laptop with 2 displays. So when the script is running and the button is found, if the mouse is in another screen then the error happens; if the mouse is in the same screen with the button, then no problem.

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

Thanks for the feedback:
In multi monitor setups, there are still some weird situations.
Is on the list to be thoroughly tested and will surely be fixed.