sikuli--pixel-based image recognition (JAVA)

Source: Internet
Author: User
Tags sikuli

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.