当前位置:网站首页>Sikuli automatic testing technology based on pattern recognition
Sikuli automatic testing technology based on pattern recognition
2022-06-26 15:10:00 【Hogwarts test development society】
As a tester , During the test process, if the application interface structure is huge , Page design changes frequently , It is difficult to locate page elements , It also requires a lot of repeated tests , What quick solutions do we have ? Maybe Sikuli Can be one of your choices , It allows you to get rid of the controls API Dependence , By retrieving the image of the current screen in real time , Get actionable object , Simulate user behavior , Verify the real screen display results .
What is? Sikuli?
Sikuli automated testing , Is the content displayed on the screen , Through image recognition , Used to locate the element , And operate GUI Components , Finally, you can judge whether the operation is successful by identifying the content in the picture . This allows testers to use screenshots instead of writing code , So as to reduce the test cost , Simplify the process of writing test scripts .
Sikuli It's in the Mexican vicho Indian language ” The eye of God ” It means , The goal is to make computers look at the real world like people , And interact with it .
Sikuli The developer of the
Sikuli Is an open source research project of the original user interface design organization at the Massachusetts Institute of technology , It is now time to maintain and further coordinate development with the open source community Sikuli The laboratory is located at the University of Boulder, Colorado . This is supportive , Part of it is awarded by the National Science Foundation IIS-0447800, Part of quanta computer TParty project .Sikuli Of MIT Issued under license .
Download and install
edition 1.1.3 The following official download page is
https://launchpad.net/sikuli/sikulix
The new version of the 1.1.4 Above in
https://raiman.github.io/SikuliX1/downloads.html
If you use 1.1.3 Under version , Double click directly in the download file to open sikulix.jar The document is sikuli Provide IDE, It can be written in a drag and drop mode .
As shown below :
This way of running depends on IDE, It is not convenient to use script startup to execute tests , So there are two other ways , Direct writing python Script to execute .
01
pure python Environmental Science -Lackey library
Lackey yes Python An automation library for , Designed for ease of use and Sikuli Cross compatibility of automated scripts . It provides a simple but powerful API, Used to find pictures on the screen , And basic user input using the mouse and keyboard .
√
Lackey Dependency Library
①
numpy
②
pillow
③
opencv
④
keyboard
Installation command :pip install Lackey
Import method in script :from lackey import *
The library supports screenshots of .bmp, .pbm, .ras, .jpg, .tiff, and .png
find("***.png"): Look for the element , There is no throw exception
exists("***.png"): Look for the element , return true or false
wait("***.png",5): Wait for the specified number of seconds , Look for the element
click("***.png"): Click on the element
dubleClick("***.png"): Double click on the element
input_(“text”): Input text
……
Implemented a similar monkey An example script for the tool is as follows ( Put all the screenshots in the project btn_pictrues Under the directory ):
02
Write python Script call sikulixapi.jar Medium API
** ** Prepare the environment
1
install jython: pip install JPype1
2
install VCForPython27
3
install JDK, And configuration %JAVA_HOME%
Possible pit
call getDefaultJVMPath, Can't find JAVA_HOME; Or start java Virtual opportunity crash . It may be due to java and python The number of digits in the installation version is different , Both are 32 Bits or 64 Bit software can run normally .
notes : Use java -d32 perhaps -d64 see 32 still 64 position ; Input... In the terminal python, As shown in the following figure 32 still 64 position .
summary
Sikuli The advantage of is simple and easy to use , Support for multiple programming languages (python/java), But the disadvantages are obvious . The resolution, color and size of the picture have a great impact on the results of the program , A successful script executed on one device may not succeed on the other device , Need to re screenshot . And can only detect the content displayed on the current desktop , The background process cannot operate ,pc All user operations on the end are not fully supported ,sikuli Itself is not perfect , It is still in the development and upgrading stage . So use sikuli Complete complex large-scale automated tests , Not the best choice yet , However, its small and beautiful features can be applied to many test scenarios
Get more related information stamps :https://qrcode.ceba.ceshiren.com/link?name=article&project_id=qrcode&from=jianshu×tamp=1656224665&author=wuyue
边栏推荐
- feil_uVission4左侧工目录消失
- 小程序:uniapp解决 vendor.js 体积过大的问题
- Unity uses skybox panoramic shader to make panorama preview. There is a gap. Solution
- 数据库-视图
- Unity UnityWebRequest 下载封装
- Redis transaction and watch instruction
- 打新债注册开户安全吗,有没有什么风险?
- It's natural for the landlord to take the rent to repay the mortgage
- Excel-VBA 快速上手(二、条件判断和循环)
- Numpy basic use
猜你喜欢

TCP congestion control details | 1 summary

English grammar_ Adjective / adverb Level 3 - original sentence pattern

使用RestCloud ETL Shell组件实现定时调度DataX离线任务

710. random numbers in the blacklist

View触摸分析

数据库-完整性约束

Use abp Zero builds a third-party login module (II): server development

10 minutes to understand bim+gis fusion, common BIM data formats and characteristics

View touch analysis

15 BS object Node name Node name String get nested node content
随机推荐
Is the QR code for account opening given by the manager of the securities firm safe? Who can I open an account with?
乐鑫 AWS IoT ExpressLink 模组达到通用可用性
一键分析硬件/IO/全国网络性能脚本(强推)
Keil4打开单片机工程一片空白,cpu100%程序卡死的问题解决
R language uses ggplot2 to visualize the results of Poisson regression model and count results under different parameter combinations
Unity C# 网络学习(九)——WWWFrom
Pytoch deep learning code skills
Redis-集群
杜老师说网站更新图解
MongoDB系列之适用场景和不适用场景
R语言epiDisplay包的dotplot函数通过点图的形式可视化不同区间数据点的频率、使用by参数指定分组参数可视化不同分组的点图分布、使用cex.X.axis参数指定X轴轴刻度数值标签字体的大小
Principle of TCP reset attack
Informatics Olympiad 1405: sum and product of prime numbers (thinking problem)
使用卷积对数据进行平滑处理
R language GLM function logistic regression model, using epidisplay package logistic The display function obtains the summary statistical information of the model (initial and adjusted odds ratio and
R语言dplyr包bind_rows函数把两个dataframe数据的行纵向(竖直)合并起来、最终行数为原来两个dataframe行数的加和(Combine Data Frames)
There are so many vulnerabilities in tcp/ip protocol?
SAP gui 770 下载
Is it safe to open an online stock account? Somebody give me an answer
R language dplyr package summary_ The at function calculates the mean and median of multiple data columns (specified by vectors) in the dataframe data, and specifies na RM parameter configuration dele