当前位置:网站首页>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 :

边栏推荐
- Which ecology is better, such as Mi family, graffiti, hilink, zhiting, etc? Analysis of five mainstream smart brands
- Building the prototype of library functions -- refer to the manual of wildfire
- Bigder:34/100 面试感觉挺好的,没有收到录取
- Structural theme model (I) STM package workflow
- Sword finger offer 29 Print matrix clockwise
- How to generate rich text online
- General process of machine learning training and parameter optimization (discussion)
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22
- Differences and usage scenarios between TCP and UDP
- Easy to use js script
猜你喜欢

Qt发布exe软件及修改exe应用程序图标
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11](/img/6a/398d9cceecdd9d7c9c4613d8b5ca27.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11

零基础自学STM32-野火——GPIO复习篇——使用绝对地址操作GPIO

Li Kou today's question -729 My schedule I
![[community personas] exclusive interview with Ma Longwei: the wheel is not easy to use, so make it yourself!](/img/aa/af98b588efd61d71b1b02609817c49.png)
[community personas] exclusive interview with Ma Longwei: the wheel is not easy to use, so make it yourself!

Pat grade a 1033 to fill or not to fill

高数_向量代数_单位向量_向量与坐标轴的夹角

ReferenceError: primordials is not defined错误解决

Reset nodejs of the system

QT release exe software and modify exe application icon
随机推荐
Ue4- how to make a simple TPS role (II) - realize the basic movement of the role
Data preparation
Follow the mouse's angle and keyboard events
Yyds dry inventory comparison of several database storage engines
550 permission denied occurs when FTP uploads files, which is not a user permission problem
[coppeliasim] efficient conveyor belt
【MySQL 15】Could not increase number of max_open_files to more than 10000 (request: 65535)
Global and Chinese market of commercial cheese crushers 2022-2028: Research Report on technology, participants, trends, market size and share
大厂镜像库
DDoS attacks - are we really at war?
好用的 JS 脚本
模板_求排列逆序对_基于归并排序
在GBase 8c数据库中使用自带工具检查健康状态时,需要注意什么?
数据准备工作
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14
Sword finger offer 29 Print matrix clockwise
如何精准识别主数据?
I changed the driver to 5.1.35, but it is still the same error. I can succeed even now, but I will report this every time I do an SQL operation
[Wu Enda machine learning] week5 programming assignment EX4 - neural network learning
深度解析链动2+1模式,颠覆传统卖货思维?