当前位置:网站首页>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
边栏推荐
- 【TcaplusDB知识库】TcaplusDB系统管理介绍
- English grammar_ Adjective / adverb Level 3 - original sentence pattern
- R语言caTools包进行数据划分、scale函数进行数据缩放、class包的knn函数构建K近邻分类器
- 房东拿租金去还房贷是天经地义的嘛
- 打新债注册开户安全吗,有没有什么风险?
- How to load the contour CAD drawing of the engineering coordinate system obtained by the designer into the new earth
- 1.会计基础--会计的几大要素(会计总论、会计科目和账户)
- Excel-VBA 快速上手(二、条件判断和循环)
- There are so many vulnerabilities in tcp/ip protocol?
- Common operation and Principle Exploration of stream
猜你喜欢

Notes on writing questions in C language -- table tennis competition

Restcloud ETL extraction de données de table de base de données dynamique

Halcon C # sets the form font and adaptively displays pictures

Keil4打开单片机工程一片空白,cpu100%程序卡死的问题解决

Redis-集群

feil_uVission4左侧工目录消失

The heavyweight white paper was released. Huawei continues to lead the new model of smart park construction in the future

qt下多个子控件信号槽绑定方法

刷题笔记(十九)--二叉树:二叉搜索树的修改与构造

关于 selenium.common.exceptions.WebDriverException: Message: An unknown server-side error 解决方案(已解决)
随机推荐
文献1
vue中缓存页面 keepAlive使用
One copy ten, CVPR oral was accused of plagiarizing a lot, and it was exposed on the last day of the conference!
TS常用数据类型总结
Advanced operation of MySQL database basic SQL statement tutorial
使用 Abp.Zero 搭建第三方登录模块(二):服务端开发
TCP拥塞控制详解 | 1. 概述
clustermeet
[solo π] ADB connects multiple mobile phones
R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用step函数基于AIC指标实现逐步回归筛选最佳模型、使用summary函数查看简单模型的汇总统计信息
Unity C# 网络学习(十)——UnityWebRequest(一)
RestCloud ETL解决shell脚本参数化
shell脚本多进程并发写法实例(高阶修炼)
Shell script multi process concurrent writing method example (high level cultivation)
The DOTPLOT function in the epidisplay package of R language visualizes the frequency of data points in different intervals in the form of point graphs, specifies the grouping parameters with the by p
编译配置in文件
Redis cluster
Unity C # e-learning (10) -- unitywebrequest (2)
数据库-完整性约束
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