Sikulix Introduction and Installation
Package Wincalc;import Org.sikuli.script.screen;public class Sikulidemo {//Sikuli is an automated test tool based on PC image recognition. At present, most GUI tools need to rely on and program type for feature recognition (attribute recognition)//testcomplete/codeui/selenium/appium/uiautomatior/watir//face different program types, Can not be effectively processed, Sikulix image recognition may take all//Skuli support for other mobile side is not friendly. Support for Python is unfriendly, jpype//image recognition matching and fault tolerance are key to its technical availability public static void main (string[] args) throws Exception {//Sikulix provides a large core class// 1, Region interface Part area recognition, high efficiency//2, screen recognition, low efficiency//define the current folder string Imgpath = System.getproperty ("User.dir") + "/wincalc";// Instantiate Screenscreen s = new screen ();//Start Win System Calculator Runtime.getruntime (). EXEC ("calc.exe");//pause for 2 seconds Thread.Sleep (2000);// Click event S.click (Imgpath + "/3.png"), S.click (Imgpath + "/+.png"), S.click (Imgpath + "/5.png"), S.click (Imgpath + "/=.png"); Thread.Sleep (2000);//judgment result Boolean test = s.exists (Imgpath + "/8.png"). IsValid (); if (test) {S.click (Imgpath + "/exit.png") ); System.out.println ("OK");} else {System.out.println ("no");}}}
sikuli--pixel-based image recognition (JAVA)