How to avoid "Select a region on the screen" in Sikuli

36 Views Asked by At

I am using sikuli for uploading a document in the selenium but whenever I run the TC, it always ask to select a region and then proceed after selecting the region. How to avoid this manual intervention.

String homeImagePath = "/src/test/resources/SampleFilesForUploading/";
homeImagePath = folderPath.replaceAll("\\\\|/", "\\" + System.getProperty("file.separator"));
homeImagePath = System.getProperty("user.dir") + folderPath + "sikuliximage-1687333079257.png";

Screen screen = new Screen();
Pattern image = new Pattern(homeImagePath);
Match r = screen.exists(image, 1);

try {
     // file = screen.capture(screen.getBounds());
     //screen.mouseMove(image);
     //screen.newRegion(530, 289, 205, 41);
     //screen.newRegion(399, 439, 264, 55).click();
     screen.click(r,0);

     System.out.println("CLicked on Home button");
     } 
catch (FindFailed e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     }

Watched a video on the YouTube and tried the same but facing the above mentioned issue

0

There are 0 best solutions below