Running from IDE: last click in the script does not work --- run script from commandline

Asked by Marc Summers on 2018-04-10

Even though my test has been saved many times
the test will not run unless I click on File -> Save
first, before I run the test again.

And no matter how many times I have saved the test
each time I want to run it, I MUST click File -> Save
first or it will not run, it starts to, the cursor gets
to the first picture to click on, but then hangs at that
point.

Sikuli 1.1.2
64 bit Windows 10
OS Version: 10.0.15063 N/A Build 15063

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Marc Summers
Solved:
2018-04-11
Last query:
2018-04-11
Last reply:
2018-04-11
RaiMan (raimund-hocke) said : #1

in such cases always first start a question.

RaiMan (raimund-hocke) said : #2

what Java version?

already tried with latest 1.1.3 nightly build?

In the Preferences -> more options: is the option "save before run" switched on (recommended)?

as a workaround you might run your script from commandline while still editing it in the IDE in parallel.

Marc Summers (2aircraft) said : #3

java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

I did not yet try the 1.1.3 nightly build

I did set the File -> Preferences -> more options...
Options on Run [ ] autosave all

This has a really odd behavior in that it appears to work
all the way down to the last click, which it misses
position wise. It clicks but in the wrong place.

But if I click on File -> Save before running then
ALL of the clicks and positioning works correctly.

I do not know how to run the script from the command line yet.

Marc Summers (2aircraft) said : #4

This is the log output if I do not click File -> Save before running the test.

Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
at java.awt.Component.getLocationOnScreen_NoTreeLock(Unknown Source)
at java.awt.Component.getLocationOnScreen(Unknown Source)
at javax.swing.text.JTextComponent$InputMethodRequestsHandler.getTextLocation(Unknown Source)
at sun.awt.im.InputMethodContext.getTextLocation(Unknown Source)
at sun.awt.windows.WInputMethod$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)

at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
at java.awt.Component.getLocationOnScreen_NoTreeLock(Unknown Source)
at java.awt.Component.getLocationOnScreen(Unknown Source)
at javax.swing.text.JTextComponent$Input

MethodRequestsHandler.getTextLocation(Unknown Source)
at sun.awt.im.InputMethodContext.getTextLocation(Unknown Source)
at sun.awt.windows.WInputMethod$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at ja

va.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
at java.awt.Component.getLocationOnScreen_NoTreeLock(Unknown Source)
at java.awt.Component.getLocationOnScreen(Unknown Source)
at javax.swing.text.JTextComponent$InputMethodRequestsHandler.getTextLocation(Unknown Source)
at sun.awt.im.InputMethodContext.getTextLocation(Unknown Source)
at sun.awt.windows.WInputMethod$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unkn

own Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

[log] CLICK on L(810,527)@S(0)[0,0 1920x1200] (4241 msec)
[log] TYPE "jsumtest1"

[log] CLICK on L(808,599)@S(0)[0,0 1920x1200] (520 msec)
[log] TYPE "Testjsum1"

[log] CLICK on L(699,694)@S(0)[0,0 1920x1200] (520 msec)

[log] CLICK on L(1507,620)@S(0)[0,0 1920x1200] (520 msec)

[log] CLICK on L(943,672)@S(0)[0,0 1920x1200] (537 msec)

[log] CLICK on L(1157,563)@S(0)[0,0 1920x1200] (520 msec)

RaiMan (raimund-hocke) said : #5

run form command line:
http://sikulix-2014.readthedocs.io/en/latest/faq/010-command-line.html#how-to-run-sikulix-from-command-line

in your case, in a command line window being in the folder that contains the younameit.sikuli:

<path-to-sikulix>\runsikulix.cmd -r younameit

Be sure the script is saved in the IDE, after having made changes and before switching to the command line.
The IDE might be left open.

RaiMan (raimund-hocke) said : #6

what happens, if you put a
wait(2)
after the last click() (that does not work always)

and run it without FileSave before?

Marc Summers (2aircraft) said : #7

OK, for right now my problem is solved, in that I changed
the technique of invocation.
Meaning that I am now running the tests via the command line.
Which works correctly every time.

So I will drop this problem for now, as I do not have
the time to do more research on it.

RaiMan (raimund-hocke) said : #8

Thanks for feedback. I reopen the bug with low priority.