sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #33522
[Question #268929]: Openn Login and check if image exists in Desktop application
New question #268929 on Sikuli:
https://answers.launchpad.net/sikuli/+question/268929
Hello,
I'm a beginner in automation and I try to use Sikuli for automate a desktop application.
I create a new project in JAVA with Eclipse, i added external jar in JAVA Build Path : sikuli-script.jar/sikuli-api-1.0.2-standalone.jar
I want to open a Desktop application and fill the login and password and after that check if a picture exist in the application.
maestro.PNG is the screenshot of my icon application and i don't know how to do next steps.
package com.example.tests;
import java.awt.Desktop;
import java.io.File;
import org.sikuli.api.DesktopScreenRegion;
import org.sikuli.api.ImageTarget;
import org.sikuli.api.ScreenRegion;
import org.sikuli.api.Target;
import org.sikuli.api.robot.Mouse;
import org.sikuli.api.robot.desktop.DesktopMouse;
import org.sikuli.script.*;
public class maestro {
public static void main(String[] args) {
ScreenRegion s = new DesktopScreenRegion();
Target tg=new ImageTarget(new File("C:\\TRAVAIL\\bandb\\POB\\maestro.PNG"));
ScreenRegion sr= s.find(tg);
System.out.println(sr);
Mouse mouse=new DesktopMouse();
mouse.click(sr.getCenter());
}
}
When i execute this code i get :
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.null
Exception in thread "main" java.lang.NullPointerException
at com.example.tests.maestro.main(maestro.java:25)
Can you give me information about that ?
Thank you
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.