当前位置:网站首页>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 :
边栏推荐
- The third level of C language punch in
- Differences and usage scenarios between TCP and UDP
- 3D drawing ()
- PAT甲级 1033 To Fill or Not to Fill
- Accident index statistics
- [robot library] awesome robots Libraries
- Six stone management: why should leaders ignore product quality
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11
- 【MySQL 15】Could not increase number of max_ open_ files to more than 10000 (request: 65535)
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
猜你喜欢
Déduisez la question d'aujourd'hui - 729. Mon emploi du temps I
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6
Pure QT version of Chinese chess: realize two-man, man-machine and network games
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22
How to generate rich text online
2022年版图解网络PDF
2022 China eye Expo, Shandong vision prevention and control exhibition, myopia, China myopia correction Exhibition
QT release exe software and modify exe application icon
UE4 - how to make a simple TPS role (I) - create a basic role
Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
随机推荐
Which ecology is better, such as Mi family, graffiti, hilink, zhiting, etc? Analysis of five mainstream smart brands
Network Security Learning - Web vulnerabilities (Part 1)
一位博士在华为的22年
Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
DDoS "fire drill" service urges companies to be prepared
MySQL winter vacation self-study 2022 11 (5)
UE4 - how to make a simple TPS role (I) - create a basic role
After changing the GCC version, make[1] appears in the compilation: cc: command not found
Global and Chinese markets of nasal oxygen tubes 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese markets for single beam side scan sonar 2022-2028: Research Report on technology, participants, trends, market size and share
Easy to use js script
深度解析链动2+1模式,颠覆传统卖货思维?
LeetCode 103. Binary tree zigzag level order transverse - Binary Tree Series Question 5
729. My schedule I / offer II 106 Bipartite graph
Paper notes: limit multi label learning galaxc (temporarily stored, not finished)
Redis installation
Reset nodejs of the system
米家、涂鸦、Hilink、智汀等生态哪家强?5大主流智能品牌分析
【无标题】数据库中一条查询SQL执行的过程
Compact lidar global and Chinese markets 2022-2028: technology, participants, trends, market size and share Research Report