Syntax for Keyboard events in pure java

Asked by triedl23

As I am Running the Sikuli Scripts from pure java through cmd i am facing issue with the keyboard events.

can any one help me about the syntax for the command ALT + "D" in pure java and the required class to use for selecting the browser addressbar (url).

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

post your script please. what windows?

Revision history for this message
triedl23 (triedl23) said :
#2

any script will make it crash! even
click(<img>)

here is the crash log written the sikuli-ide-folder: http://jockl.kilu.de/files/hs_err_pid2224.log

here is a short summary of my system:

CPU Typ AMD Sempron, 2000 MHz (12 x 167) 2800+
Motherboard Name ECS N2U400-A (5 PCI, 1 AGP, 3 DDR DIMM, Audio)
Motherboard Chipsatz nVIDIA nForce2 Ultra 400
RAM 1024 MB (PC3200 DDR SDRAM)
OS Windows XP Professional, Service Pack 3

JRE Java 6, Update 18, (Build 1.6.0_18-b07)

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

The crash seems to happen, when the IDE tries to capture the screen.

Do you have any "not normal" screen situations (more than one monitor, screen multiplier utilities (1 monitor, many virtual screens), ...).

Sikuli this time only works, if the actions happen on the first physical screen.

your installation looks ok.

Revision history for this message
triedl23 (triedl23) said :
#4

Capturing the screen, to insert the to-find-images using the image-icon below the "File"-menu works (it takes a few seconds before the screen turns gray, in order to take the screenshot).

No, i am not using multiple monitiors or virtual screens. I am using the omegadrivers (www.omegadrivers.net) instead of the catalyst-drivers instead thou, if that matters. Screen resolution is 1680 x 1050.

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

ok, seems normal.

last idea: your 1GB RAM seems rather scanty. Do you get other apps up and running, that need the JRE? May be its some bad memory management in a situation, were RAM is low. Sikuli is rather complex concerning the components that have to play together and bad memory management often is the reason for crashes if memory is a shortcoming.

any chance to test this?

Good luck ;-)

Revision history for this message
triedl23 (triedl23) said :
#6

no other java applications running. i doubt, that this causes it, also the swapfile is set to 1gb fixed, too. :/

Revision history for this message
chimanfu (jfu) said :
#7

Me too. The Sikuli always crashes om me without any warning or reason. It seems to be randomly. Usually it can only execute a few steps (click, wait, etc...) then it'll crash. I have 4 G of memory and I only have IE and your tool running.

Man.....is your tool really working?

It's fun to work on at the beginning though.

Revision history for this message
srijith (electronicmails1) said :
#8

I keep GUI testing in my office in the evening and when I come back and see at the morning, I find that the SIKULI has stopped the test. ( the sikuli IDE was open, It jus stopped testing)

here is the last few lines of log

0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
[sikuli] [Error] source lineNo: 13
[sikuli] [Error] Traceback (innermost last):
  File "/tmp/sikuli-tmp8246551724979915755.py", line 13, in ?
  File "/home/qvis/Sikuli-IDE/sikuli-script.jar/Lib/python/edu/mit/csail/uid/Sikuli.py", line 361, in find
 at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1169)
 at javax.imageio.ImageWriter.write(ImageWriter.java:615)
 at javax.imageio.ImageIO.doWrite(ImageIO.java:1602)
 at javax.imageio.ImageIO.write(ImageIO.java:1526)
 at edu.mit.csail.uid.ScreenCapturer.capture(SikuliScript.java:44)
 at edu.mit.csail.uid.ScreenCapturer.capture(SikuliScript.java:36)
 at edu.mit.csail.uid.SikuliScript.find_without_wait(SikuliScript.java:184)
 at edu.mit.csail.uid.SikuliScript.wait(SikuliScript.java:197)
 at edu.mit.csail.uid.SikuliScript.find(SikuliScript.java:178)
 at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:616)

javax.imageio.IIOException: javax.imageio.IIOException: I/O error writing PNG file!

Revision history for this message
srijith (electronicmails1) said :
#9

I keep GUI testing in my office in the evening and when I come back and see at the morning, I find that the SIKULI has stopped the test. ( the sikuli IDE was open, It jus stopped testing)

here is the last few lines of log

0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
0 matches found
capture: java.awt.Rectangle[x=0,y=0,width=1440,height=900]
[sikuli] [Error] source lineNo: 13
[sikuli] [Error] Traceback (innermost last):
  File "/tmp/sikuli-tmp8246551724979915755.py", line 13, in ?
  File "/home/qvis/Sikuli-IDE/sikuli-script.jar/Lib/python/edu/mit/csail/uid/Sikuli.py", line 361, in find
 at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1169)
 at javax.imageio.ImageWriter.write(ImageWriter.java:615)
 at javax.imageio.ImageIO.doWrite(ImageIO.java:1602)
 at javax.imageio.ImageIO.write(ImageIO.java:1526)
 at edu.mit.csail.uid.ScreenCapturer.capture(SikuliScript.java:44)
 at edu.mit.csail.uid.ScreenCapturer.capture(SikuliScript.java:36)
 at edu.mit.csail.uid.SikuliScript.find_without_wait(SikuliScript.java:184)
 at edu.mit.csail.uid.SikuliScript.wait(SikuliScript.java:197)
 at edu.mit.csail.uid.SikuliScript.find(SikuliScript.java:178)
 at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:616)

javax.imageio.IIOException: javax.imageio.IIOException: I/O error writing PNG file!

Can you help with this problem?

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

To post a message you must log in.