Question #268929 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/268929

    Status: Answered => Open

ouedghiri is still having a problem:
Hello RainMan,

I have followed exactly the same steps as defined in documentation and
wiki for sikuli API, and finally i got this errors, I don't know what is
exactly the problem

The steps are defined below :

1- Download sikuli-api-1.0.2-standalone.jar 
2- Create a JAVA PROJECT in Eclipse 
3- Add sikuli-api-1.0.2-standalone.jar to Build Path 

Code :

package testsikuli;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.sikuli.api.*;
import org.sikuli.api.robot.Mouse;
import org.sikuli.api.robot.desktop.DesktopMouse;
import org.sikuli.api.visual.Canvas;
import org.sikuli.api.visual.DesktopCanvas;
import static org.sikuli.api.API.*;

public class testimage {
         public static void main(String[] args) throws MalformedURLException {


                 ScreenRegion s = new DesktopScreenRegion();
                 Target tg=new ImageTarget(new 
File("C:\\TRAVAIL\\bandb\\POB\\maestro.PNG"));
                 ScreenRegion sr= s.find(tg);
                 Canvas canvas = new DesktopCanvas();
                 canvas.addBox(sr);
                 canvas.addLabel(Relative.to(sr).above(30).getScreenRegion(), 
"Ecliiiipse!");
                 canvas.display(3);
                 //System.out.println(sr.getBounds());
                      System.out.println(sr);
                      Mouse mouse=new DesktopMouse(); 
                      mouse.click(sr.getCenter());
                        
                         }
}

When i execute this code i got :

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further 
details.
Exception in thread "main" java.lang.NullPointerException
        at org.sikuli.api.visual.Canvas.addBox(Canvas.java:220)
        at testsikuli.testimage.main(testimage.java:20)

I want to use SikuliX for automate simple tests in my Desktop application. 
1- Write login and Password to connect in application 
2- Search a word 
3- Check if the picture is ok

I don't know exacctly all steps and which library I must have.

Thank you for your help

Yassine

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to