当前位置:网站首页>Interface automation test platform fasterrunner series (II) - function module
Interface automation test platform fasterrunner series (II) - function module
2022-07-25 18:47:00 【wangmcn】
Interface automation test platform FasterRunner series ( Two )
Function module
Catalog
- 1、 home page
- 2、 Project overview
- 3、API Templates
- 3.1、 grouping
- 3.2、 Interface
- 3.2.1、Header
- 3.2.2、Request
- 3.2.3、Extract
- 3.2.4、Validate
- 3.2.5、Variables
- 3.2.6、Hooks
- 3.3、 function
- 3.3.1、 Single interface operation
- 3.3.2、 Specify the group to run
- 4、 The test case
- 4.1、 grouping
- 4.2、 Use case set
- 4.3、 function
- 4.3.1、 The use case set runs
- 4.3.2、 Specify the group to run
- 5、 Configuration Management
- 5.1、Header
- 5.2、Request
- 5.3、Variables
- 5.4、Hooks
- 5.5、Parameters
- 6、 Global variables
- 7、 Domain name management
- 8、 Driver code
- 9、 Timing task
- 10、 Historical report
1、 home page
Use registered users admin Log in , After logging in, jump to the home page by default .
On the left is the menu bar , The project name is displayed on the right 、 person in charge 、 Project description 、 Update time . You can add 、 see 、 edit 、 Delete the project .
notes : The deletion operation will force the deletion of all data under this item , Please operate carefully .
Click on the details of the specified project , It will jump to the project overview page .
2、 Project overview
The project overview page details some information about the current project .
As shown in the figure : existing 4 Interface 、1 Use case set 、1 Set configuration 、1 The variable 、1 Environment 、1 Tasks 、51 A report .
3、API Templates
3.1、 grouping
Create a new group first ( It's actually a module ), You can delete the created group 、 Rename and so on . Sub groups can also be created under groups . Create an interface on the specified group , Then maintain the interface information .
notes : The deletion operation will force the deletion of all data under the Group , Please operate carefully .
As shown in the figure : Create group module 1,module 1 Has been created on 4 Interface .
3.2、 Interface
Click Add interface , Enter the interface name 、 Request method ( Support POST、GET、PUT、DELETE etc. )、 Request address and other information , Execution time , You can set the number of iterations , The default is 1 Time .
For the interface that has been created , It can be modified 、 name 、 function 、 Delete operation .
3.2.1、Header
Request header
3.2.2、Request
Request parameters ( about POST Method , A form refers to a form in which the message body is a key value pair ,json Means that the message body is json strand ;params Refers to using GET Method with URL Later parameters ).
Use Variable name To reference its variable value . for example username
Use { Function name ( Parameters 1, Parameters 2, …)} To call a function . for example {get_userId()}
3.2.3、Extract
Extract the return value of the interface
After completing the request , Extract data from the returned content and store it in variables , In a later request , You can get this value by referencing this variable .
Suppose we return to json, So that is content.key perhaps content.key.0.key form (0 It's the index ).
Extract complex return values , for example : extract content Of dataList Of the first element of the list name Fields are in the form of strings ’.ABC’ At the end of the .content.dataList.0.name/endswith/(string)/’.ABC’
3.2.4、Validate
Interface assertion
You can reference Extract Inside , You can also extract directly .
Use Variable name To reference its variable value . for example username
Use { Function name ( Parameters 1, Parameters 2, …)} To call a function . for example {get_userId()}
3.2.5、Variables
local variable
Only valid in the current use case . You can give Request、Validate, adopt $ Variable name It can be referenced by .
3.2.6、Hooks
hook Mechanism
(1) Methods performed before testing : stay HTTP Execute before sending the request hook Mechanism , It's mainly for preparatory work ; You can also implement the request Request The content is preprocessed .
(2) The method executed after the test : stay HTTP The request is sent and executed hook Mechanism , It is mainly used for cleaning after testing ; Response can also be realized Response Make changes , For example, processing such as encryption and decryption .
Use Variable name To reference its variable value . for example username
Use { Function name ( Parameters 1, Parameters 2, …)} To call a function . for example {get_userId()}
3.3、 function
3.3.1、 Single interface operation
1、 Selection environment 、 Select the configuration 、 Click on the run , Execute the specified interface .
2、 After execution , The current page displays the report .
3、 stay “ Historical report ” This report will also be recorded under .
3.3.2、 Specify the group to run
1、 Selection environment 、 Select the configuration 、 Click on the run , Then choose synchronous execution or asynchronous execution ( Custom asynchronous report name support , Default timestamp naming ), Select the group to run , Click ok .
Synchronous execution : It refers to waiting for the completion of use case execution on the current page , The execution report page will pop up automatically on the current page , stay “ Historical report ” This report will also be recorded under .
Asynchronous execution : It means that the use case is executed in the background , After execution, the report will not be actively displayed on the page , It will only be kept in “ Historical report ” Next , Users need to check by themselves .
2、 Report results :
(1) Synchronous execution
The report type is debug
(2) Asynchronous execution
The report type is asynchronous
First custom report name , The second default timestamp is named .
4、 The test case
4.1、 grouping
First create a group ( It's actually a module ), You can delete the created group 、 Rename and so on .
notes : Deleting will force all data under this module to be deleted , Please operate carefully .
As shown in the figure : Create group TestSuite
4.2、 Use case set
1、 Click Add use case , Add a test case set , Select the use cases and configurations to execute , Drag and drop the selected use case , The execution sequence can be set ( Mainly for interface process testing ), Save it at last .
2、 You can modify the new use case set 、 function 、 name 、 Delete operation .
4.3、 function
4.3.1、 The use case set runs
1、 Click on the run , Execute the specified use case set .
2、 After execution , The current page displays the report . Also in “ Historical report ” This report will also be recorded under .
4.3.2、 Specify the group to run
Run the specified group , The execution mode is also divided into synchronous execution or asynchronous execution ( Custom asynchronous report name support , Default timestamp naming ), Select the group to run , Click ok .
Synchronous execution : It refers to waiting for the completion of use case execution on the current page , The execution report page will pop up automatically on the current page , stay “ Historical report ” This report will also be recorded under .
Asynchronous execution : It means that the use case is executed in the background , After execution, the report will not be actively displayed on the page , It will only be kept in “ Historical report ” Next , Users need to check by themselves .
Report the effect and in API The template runs in the same way as the specified group .
5、 Configuration Management
1、 New configuration , You can define the global Hooks, public Request Parameters and public Header, Generally, it can be used to verify the environment switching configuration .
2、 For existing configurations , It can be modified 、 name 、 Delete operation .
5.1、Header
Request header
5.2、Request
Request parameters ( about POST Method , A form refers to a form in which the message body is a key value pair ,json Means that the message body is json strand ;params Refers to using GET Method with URL Later parameters ).
Use Variable name To reference its variable value . for example username
Use { Function name ( Parameters 1, Parameters 2, …)} To call a function . for example {get_userId()}
5.3、Variables
local variable
Only valid in the current use case set . You can give Request、Validate, adopt $ Variable name It can be referenced by .
5.4、Hooks
hook Mechanism
(1) Methods performed before testing : stay HTTP Execute before sending the request hook Mechanism , It's mainly for preparatory work ; You can also implement the request Request The content is preprocessed .
(2) The method executed after the test : stay HTTP The request is sent and executed hook Mechanism , It is mainly used for cleaning after testing ; Response can also be realized Response Make changes , For example, processing such as encryption and decryption .
Use Variable name To reference its variable value . for example username
Use { Function name ( Parameters 1, Parameters 2, …)} To call a function . for example {get_userId()}
5.5、Parameters
parameter list
Put a variety of possible values of the variable in the parameter list , Then this example will automatically use these multiple values to execute once . Pay attention to the following points :
(1) For multiple parameter lists at the same time , You need to perform... Once for each case of its permutation and combination .
for example :
xx : [xxvalue1, xxvalue2]
yy : [yyvalue1, yyvalue2, yyvalue3]
Use cases will be executed once in each of the following six cases :
xx=xxvalue1, yy=yyvalue1
xx=xxvalue1, yy=yyvalue2
xx=xxvalue1, yy=yyvalue3
xx=xxvalue2, yy=yyvalue1
xx=xxvalue2, yy=yyvalue2
xx=xxvalue2, yy=yyvalue3
(2) If there is a corresponding relationship between parameters , Can press xx-yy: [xxvalue1-yyvaule1, xxvalue2-yyvalue2] Method definition of , Only two situations will be executed , This avoids invalid permutations :
xx=xxvalue1, yy=yyvalue1
xx=xxvalue2, yy=yyvalue2
Using multiple accounts / When testing passwords , This way is often used .
6、 Global variables
New variable , Defined as a global variable , Convenient use case or use case set reference .
And can modify and delete variables .
7、 Domain name management
New environment , Define domain name .
And can modify and delete the domain name .
8、 Driver code
Custom auxiliary functions , You can write something Python Script .
Used for the current project call , It can also conduct online debugging and operation , The operation log information can be printed out on the debugging console .
The method of calling the function is ${ Function name ( Parameters 1, Parameters 2, …)}
If there is one get_userId() function , The method of calling this function is ${get_userId()}
If there is one get_userId(id) function , Parameters id As a variable ,get_id Can get id value , The method of calling this function is {get_userId(
9、 Timing task
Click add task , Create a scheduled task , Add scheduled tasks for the use case set , follow crontab expression , It can be set to send the report to the designated mailbox .
crontab Example :
10 * * * * each X Hours 10 Execute once .
*/10 * * * * each 10 Once per minute .
1、 Add tasks , Enter configuration information .
2、 Select the specified use case set , Click save .
3、 After the scheduled task is added .
4、 Follow the regular execution rules , Send the test report to the mailbox .
5、 stay “ Historical report ” Next , You can see the report after execution , The report type is scheduled .
10、 Historical report
You can view the synchronous execution 、 Reports of asynchronous execution and scheduled task execution , Will be stored in the database , The report can be viewed online , You can also delete 、 Search operations .
Open the report display effect ( be based on ExtentReports Realization ).
The original background color defaults to white , It has been customized and modified to black by default .
边栏推荐
- Twitter acquired a public opinion war, which was turned into a child quarrel by musk
- 阿里云技术专家郝晨栋:云上可观测能力——问题的发现与定位实践
- How developers choose the right database for react native
- ES6通过代理器(Proxy)与反射(Reflect)实现观察者模式
- Share six practical applet plug-ins
- 3de 回复
- CircleIndicator组件,使指示器风格更加多样化
- Typescript反射对象Reflect使用
- 软件测试进阶篇—测试分类
- 华为年内二度招聘“天才少年”;540万Twitter账号信息泄露,卖价3万美元;谷歌解雇了相信AI有意识的工程师|极客头条
猜你喜欢

Visual model network connection

Northeast people know sexiness best

终极套娃 2.0 | 云原生交付的封装

TypeError: Unrecognized value type: <class ‘str‘> ParserError: Unknown string format

Dynamic memory management

What is the difference between GB and gib disk space units?

Introduction notes of JVM foundation and problem analysis

#yyds干货盘点# 面试必刷TOP101:反转链表

The auction house is a VC, and the first time it makes a move, it throws a Web3

Ultimate doll 2.0 | cloud native delivery package
随机推荐
How high are the young people in this class for "ugly things"?
进程间的通信(管道通信)
Osmosis通过与Axelar和Moonbeam的集成将跨链足迹扩展至波卡
软件测试流程(思维导图)
srec_cat 常用参数的使用
The Yellow Crane Tower has a super shocking perspective. You've never seen such a VR panorama!
[applet development] page navigation details
一个免费的镜像下载仓库网站
银行理财子公司蓄力布局A股;现金管理类理财产品整改加速
Ping 命令详解[通俗易懂]
2022 Robocom 省赛题解
The understanding of domain adaptation in transfer learning and the introduction of three technologies
优秀的测试/开发程序员突破,不忘初心,方得始终......
Insufficient space on Disk C mklink solves vscode expansion migration to other disks
接口自动化测试平台FasterRunner系列(四)- 持续集成、解决多域名
阿里云技术专家秦隆:可靠性保障必备——云上如何进行混沌工程?
A brief history from object detection to image segmentation
什么是hpaPaaS平台?
人人可参与开源活动正式上线,诚邀您来体验!
Summer Challenge [FFH] this midsummer, a "cool" code rain!