当前位置:网站首页>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 :
边栏推荐
- Data preparation
- Large scale DDoS attacks take Myanmar offline
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 23
- 剑指 Offer 29. 顺时针打印矩阵
- 3D drawing ()
- 构建库函数的雏形——参照野火的手册
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 24
- [untitled] a query SQL execution process in the database
- Lecture 4 of Data Engineering Series: sample engineering of data centric AI
- Microsoft speech synthesis assistant v1.3 text to speech tool, real speech AI generator
猜你喜欢
[Wu Enda machine learning] week5 programming assignment EX4 - neural network learning
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11
爬虫(9) - Scrapy框架(1) | Scrapy 异步网络爬虫框架
2022.02.13
力扣今日题-729. 我的日程安排表 I
"Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.5 automatic differentiation_ Learning thinking and exercise answers
Which ecology is better, such as Mi family, graffiti, hilink, zhiting, etc? Analysis of five mainstream smart brands
HttpRunnerManager安装(三)-Linux下配置myql数据库&初始化数据
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7
米家、涂鸦、Hilink、智汀等生态哪家强?5大主流智能品牌分析
随机推荐
Data preparation
07 单件(Singleton)模式
2022 edition illustrated network pdf
MySQL winter vacation self-study 2022 11 (9)
Trends in DDoS Attacks
Large scale DDoS attacks take Myanmar offline
QT release exe software and modify exe application icon
[coppeliasim] efficient conveyor belt
MySQL winter vacation self-study 2022 11 (6)
Six stone management: why should leaders ignore product quality
What should we pay attention to when using the built-in tool to check the health status in gbase 8C database?
我把驱动换成了5.1.35,但是还是一样的错误,我现在是能连成功,但是我每做一次sql操作都会报这个
Method of changing object properties
高数_向量代数_单位向量_向量与坐标轴的夹角
Bigder: I felt good about the 34/100 interview, but I didn't receive the admission
Pat grade a 1033 to fill or not to fill
Initial understanding of pointer variables
Template_ Quick sort_ Double pointer
Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
Redis installation