Java: How to use images captured with Sikuli IDE

Asked by Anurag sharma

Hello..
Currently im working on Sikuli-IDE (X 1.0rc5) and i have recorded some visual scripts..
when i recorded it shows the captured snaps and one .py file.
my question is that is there posible to devide that recorded Sikuli script in to two folder one is only snap and second one have .py files and after tht i open only .py file where all the information of image is capture but it doesnt open ????

i.e. in .py file the file name is <123456789.png> and second folder name is imgae and i make it like that for <image\123456789.png> and i'll try to open it but it doesnt work

is this possible????

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

Principally it is possible that way.

But there is no need to split the .sikuli folder. Leave it as is, so you can come back and open it again with Sikuli IDE to change something with the captured images or capture new ones. The .py file does no harm in Java ;-)

So in your Java code you have to use a correct filename

s = new Screen();
s.find("absolute-path-to-images.sikuli\\some-image.png");

should work.

when using relative paths, the image folder must be in the right place relative to your Eclipse runtime environment.

Alternatively you can use Sikuli's image path feature to let Sikuli find the images itself (no need to specify a path with the images).

Revision history for this message
Anurag sharma (anurag-sharma) said :
#2

how can i integrate sikuli with eclipse??
wht process i done to coplete the integrate i'll try to do it but i cudnt reach the final point

i work on win xp, sikuli-X 1.0rc5, eclipse helios 3.6

pls mention me abt the system n all the thing tht i follow..

i capture snap from sikuli-IDE it work but when i write it in eclipse it doesnt work
i write program :-

import org.sikuli.script.*;

public class sikuliproject {

        public static void main(String[] args) {
                Screen s = new Screen();
                try{
                        s.hover("image.sikuli/1321439242218.png");
                        s.find("image.sikuli/1321439255546.png");
                        s.doubleClick("image.sikuli/1321439267640.png");
                        s.wait("image.sikuli/U1L11MLLI1KL.png", 5000);
                        s.find("image.sikuli/EhL1LMLI1LLQ.png");
                        s.find("image.sikuli/BHUTBQMicros.png");
                        s.doubleClick("image.sikuli/1321439584234.png");
                        s.wait("image.sikuli/uluMicrosoft.png", 5000);
                        s.find("image.sikuli/cMicrosoftWo.png");
                        s.find("image.sikuli/3fUf3g-1.png");
                        s.click("image.sikuli/ag-1.png");
                        s.type(null, "Key.SPACE", 0);
                        s.type(null, "Sharma\n", 0);

                }
                catch(FindFailed e){
                        e.printStackTrace();
                }}}

the console show following error's now wht can i do-

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/awt/AWTUtilities
 at org.sikuli.script.Win32Util.setWindowOpaque(Win32Util.java:84)
 at org.sikuli.script.ScreenHighlighter.init(ScreenHighlighter.java:180)
 at org.sikuli.script.ScreenHighlighter.<init>(ScreenHighlighter.java:293)
 at org.sikuli.script.Screen.initBounds(Screen.java:105)
 at org.sikuli.script.Screen.<init>(Screen.java:117)
 at sikuliproject.main(sikuliproject.java:6)
[info] Windows utilities loaded.

pls explain me each step which i follow related to x path or eclipse .........

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

do you have
path-to-java/java/jre6/bin
in your system path, when Eclipse is running a Java program?

Revision history for this message
Anurag sharma (anurag-sharma) said :
#4

yes i have path -to-java\java\jre6\bin in my system variable path..

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

Using Java 7 ??

Revision history for this message
Anurag sharma (anurag-sharma) said :
#6

no im using java 6

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

Try the latest official Oracle JRE version.

Can you help with this problem?

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

To post a message you must log in.