Trying to automate desktop application using sikuli integrated with eclipse.

asked 2019-09-09 23:51:27 -0600

I am new to sikuli, I have built a maven project (added 'sikulixapi.jar' in build path). Problem Description: 1.Create a screenshot folder inside the project directory. Placed all the images in the same folder 'screenshot'. 2.Was trying to click on the word document, so created the blank document named it 'Doc2.png'. The same image and the file is placed inside the screenshot folder (inside the project directory).

Sharing the code snippet as well:

package SikuliAutomation;

import; import org.sikuli.script.ImagePath; import org.sikuli.script.FindFailed; import org.sikuli.script.Screen;

public class SikuliWordAutomate {

public static void main(String[] args) throws FindFailed  {
    // TODO Auto-generated method stub
    String basePath=System.getProperty("user.dir");
    String extPath=basePath+File.separator+"screenshot";
    String paths = ImagePath.getBundlePath();


    Screen s = new Screen();
    System.out.println("File icon clicked");



Problem: Every time I am trying to run the code, its throwing error

/Users/sayanisengupta/Desktop/EclipseWorkspace/SikuliPOC/screenshot /Users/sayanisengupta/Desktop/EclipseWorkspace/SikuliPOC/screenshot Exception in thread "main" CvException [org.opencv.core.CvException: cv::Exception: OpenCV(3.4.2) /Users/raimundhocke/SikuliX/OpenCV/opencv-3.4.2/modules/core/src/matrix.cpp:235: error: (-215:Assertion failed) s >= 0 in function 'setSize' ] at org.opencv.imgproc.Imgproc.matchTemplate_0(Native Method) at org.opencv.imgproc.Imgproc.matchTemplate( at org.sikuli.script.Finder$Finder2.doFindMatch( at org.sikuli.script.Finder$Finder2.doFind( at org.sikuli.script.Finder$Finder2.find( at org.sikuli.script.Finder.find( at org.sikuli.script.Region.runFinder( at org.sikuli.script.Region.doFind( at org.sikuli.script.Region.find( at SikuliAutomation.SikuliWordAutomate.main(

Please help me on the same, let me know how to resolve this issue.

edit retag flag offensive close merge delete


Sorry : Basically the following types of questions are not allowed on this forum:

Questions about problems with openCV wrappers (EmguCV, JavaCV, OpenCVSharp, ...) or extension libraries
LBerger gravatar imageLBerger ( 2019-09-10 02:01:33 -0600 )edit