sleep interrupted exception

Asked by Jonathan

I am using SikulixIDE 1.1.0 Build 2015-06-24_01:00nightly on a MAC OS X 10.7.5

My program has been working for hours going over the same piece of code then suddenly I get thrown off the game I am monitoring as I failed to act in time. When I shift alt c sikuli I see the following in the log

[error] script [ main ]] stopped with error at line --unknown--
[error] Could not evaluate error source nor reason. Analyze StackTrace!
[error]

java.lang.InterruptedException: sleep interrupted
 at java.lang.Thread.sleep(Native Method)
 at java.awt.Robot.delay(Robot.java:427)
 at org.sikuli.script.RobotDesktop.delay(RobotDesktop.java:227)
 at java.awt.Robot.autoDelay(Robot.java:413)
 at java.awt.Robot.afterEvent(Robot.java:363)
 at java.awt.Robot.mouseRelease(Robot.java:204)
 at org.sikuli.script.RobotDesktop.doMouseUp(RobotDesktop.java:90)
 at org.sikuli.script.RobotDesktop.mouseUp(RobotDesktop.java:201)
 at org.sikuli.script.Mouse.up(Mouse.java:383)
 at org.sikuli.script.Mouse.up(Mouse.java:367)
 at org.sikuli.script.Mouse.reset(Mouse.java:102)
 at org.sikuli.script.Sikulix.cleanUp(Sikulix.java:328)
 at org.sikuli.ide.SikuliIDE$ButtonRun$1.run(SikuliIDE.java:2385)

from what I can gather it was executing the following line when this happened

        wait(foldButton_L,FOREVER) # When fold button appears it is my turn

I can assure you the fold button would have appeared. but it seems Sikuli failed to pick it up.
Is Sikuli just not infallible and sometimes I will have to expect it to fail or is there something else going on here?

Is the sleep interruption part of the fold button not being found or is it because I aborted the script to see the log and it was still in the middle of waiting for the fold button?

Thanks

Jonathan

Question information

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

the sleep interruption is the normal reaction when pressing the abort key, while the code is waiting using the respective Java feature Thread.sleep() (which it repeatedly does during the wait(image, FOREVER).

The image simply is not found. so check the image and the screen situation.
already slight differences against the situation, when you shot the image to wait for, might lead to not found.

Revision history for this message
Jonathan (jonathan-clark404) said :
#2

Thanks for the feedback. Helps me understand the situation better.

Jonathan

Revision history for this message
Jonathan (jonathan-clark404) said :
#3

Just a thought. If the cursor was left hovering over the image does Sikuli ignore this or take the cursor as part of the image? In other words should I move the cursor away from the region where I expect the image to appear?

Jonathan

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

cursor is generally ignored.

Revision history for this message
Eugene Maslov (emaslov1) said :
#5

However, some applications draw the cursor themselves over some of their graphical viewers etc. Press PrintScreen key and paste the image somewhere. If it's the case, the cursor will be present in the picture.

Can you help with this problem?

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

To post a message you must log in.