当前位置:网站首页>Introduction to robotframework (I) brief introduction and use
Introduction to robotframework (I) brief introduction and use
2022-07-06 02:37:00 【Makasa】
Preface
This chapter focuses on Robotframework Brief introduction and use of
One 、 Brief introduction
Robotframework: It's based on Python Language Developed , Extensible , yes Keyword driven mode Automatic testing framework of ,Robotframework The latest version is 2019 year 7 in ,7 Before the month, only python2.7,7 Support after months 3.X Version of
First of all, let's talk about it briefly 【 Keyword driven mode 】 and 【 Data driven mode 】 The meaning of :
Keyword driven mode : That is to put Some logic is encapsulated into keywords ( A function name ), Then we can call Different keywords The combination realizes different business logic , So as to drive the execution of test cases
for example :UI In automation , Each use case step can be written as a method , And then in robot Directly reference this method name inin addition Data driven mode : Namely Realize parameterized data
for example : stay API In automation , For example, for the framework pytest/unittest, We usually implement parameterization , Put your Parameters are uniformly written in external files (excel、yaml、txt、csv…) in , Then parameterize the request by reading the external file , In this case, we only need to maintain and change your external files , Commonly used packages :@ddt
Robotframework characteristic :
1) Editing use cases is simple , We can use robot,txt,tsv perhaps html Write use cases in the format of
2) Automatic generation html Format test report and log (HtmlTestRunner.py,allure)
3) Not only has its own class library :
Buitini( Test library )
Collections( Collection library )
Date Time( Time bank )
ScreenShot( Screenshot Library )
There are also many other practical class extension libraries :
SeleniumLibrary(web automated testing )
RequestsLibrary( Interface automation testing )
AppiumLibrary(APP automated testing )
4) You can customize some keywords according to the needs of the project
5) have access to GUI How to run , You can talk to SVN perhaps GIT And Jenkins Continuous integration
Two 、RobotFramework download
#robotframework
pip install robotframework==3.1.2
#ride, Can be done GUI operation
pip install robotframework-ride==1.7.4.1
# After downloading, all the extension libraries will be placed in python\Lib\site-packages Under the folder
# web Automated third-party libraries , Conduct UI Download during automatic operation ,
pip install robotframework-selenium2library 3.0.0
pip install robotframework-seleniumlibrary 4.3.0
# Interface automation test library
pip install robotframework-requests
# appui Automated third-party libraries
pip install robotframework-appiumlibrary
3、 ... and 、Ride Basic use
1、 establish ride Desktop shortcuts
- Normally install robotframework-ride You will be automatically prompted to create a desktop shortcut , But occasionally the creation fails , So let's talk about it here ride Shortcut creation
# Icon path : Yours python Under the path \Lib..
D:\Mikasa_develop\Python36\Lib\site-packages\robotide\widgets\robot.ico
2、 Common shortcut key
# 1、 Search keywords
F5
# 2、 Keyword auto completion
ctrl+shift+ Space
Four 、 Simple robot Use case practice
1、 Create project (New Project)
- File --> New Project,Type choice Directory,Format choice Robot
2、 Create a module (New Directory)
- Right click on the item --> choice New Directory
3、 Create a test suite (New Suite)
- Right click on the module --> choice New Suite
4、 Create test cases (New Test Case)
- Right click Suite --> choice New Test Case
5、 Create a resource file (New Resource)
- The resource file is 【 Custom keywords 】 The carrier of
Be careful : It can only be created under the folder , And is txt Format
6、 Create business keywords (New User Keyword)
- Create a new business keyword under the resource file
7、 Common keyword use case writing
- These are robot Common keywords , But in fact, in our own project UI/App When automating , We usually use custom keywords
- Be careful : About the solution of coding, you can see this article in detail , I won't talk too much
http://t.zoukankan.com/panda-sweets-p-13730365.html
robot According to the report :
边栏推荐
- ftp上传文件时出现 550 Permission denied,不是用户权限问题
- 高数_向量代数_单位向量_向量与坐标轴的夹角
- Number conclusion LC skimming review - 1
- Template_ Find the reverse pair of permutations_ Sort based on merge
- High number_ Vector algebra_ Unit vector_ Angle between vector and coordinate axis
- [Digital IC manual tearing code] Verilog asynchronous reset synchronous release | topic | principle | design | simulation
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13
- There are so many giants, why should we independently develop POS store cashier system?
- Thinking on Architecture Design (under continuous updating)
- 好用的 JS 脚本
猜你喜欢
Ue4- how to make a simple TPS role (II) - realize the basic movement of the role
一位博士在华为的22年
2022.02.13
Which ecology is better, such as Mi family, graffiti, hilink, zhiting, etc? Analysis of five mainstream smart brands
剑指 Offer 30. 包含min函数的栈
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7
米家、涂鸦、Hilink、智汀等生态哪家强?5大主流智能品牌分析
Minecraft 1.18.1, 1.18.2 module development 22 Sniper rifle
技术管理进阶——什么是管理者之体力、脑力、心力
Blue Bridge Cup group B provincial preliminaries first question 2013 (Gauss Diary)
随机推荐
深度解析链动2+1模式,颠覆传统卖货思维?
微软语音合成助手 v1.3 文本转语音工具,真实语音AI生成器
Template_ Find the reverse pair of permutations_ Sort based on merge
3D drawing ()
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17
Pure QT version of Chinese chess: realize two-man, man-machine and network games
Zero basic self-study STM32 wildfire review of GPIO use absolute address to operate GPIO
How to improve the enthusiasm of consumers when the member points marketing system is operated?
ftp上传文件时出现 550 Permission denied,不是用户权限问题
【MySQL 15】Could not increase number of max_ open_ files to more than 10000 (request: 65535)
Which ecology is better, such as Mi family, graffiti, hilink, zhiting, etc? Analysis of five mainstream smart brands
Is there a case where sqlcdc monitors multiple tables and then associates them to sink to another table? All operations in MySQL
Trends in DDoS Attacks
主数据管理(MDM)的成熟度
球面透镜与柱面透镜
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10
PAT甲级 1033 To Fill or Not to Fill
米家、涂鸦、Hilink、智汀等生态哪家强?5大主流智能品牌分析
[robot library] awesome robots Libraries
一位博士在华为的22年