当前位置:网站首页>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 .
边栏推荐
- 7/24 training log
- Partial correlation calculation of R language and partial correlations calculation using pcor function of GGM package
- Trust multithread security count
- 拍卖行作VC,第一次出手就投了个Web3
- Nc68 jumping steps
- Care for front-line epidemic prevention workers, Haocheng JIAYE and Gaomidian sub district office jointly build the great wall of public welfare
- Typescript object proxy use
- Add a little surprise to life and be a prototype designer of creative life -- sharing with X contestants in the programming challenge
- Yyds dry inventory interview must brush top101: reverse linked list
- 银行理财子公司蓄力布局A股;现金管理类理财产品整改加速
猜你喜欢

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

分享六个实用的小程序插件

8 年产品经验,我总结了这些持续高效研发实践经验 · 研发篇

关爱一线防疫工作者,浩城嘉业携手高米店街道办事处共筑公益长城

上半年出货量已超去年全年,森思泰克毫米波雷达“夺食”国际巨头

MySQL index optimization introduction

The understanding of domain adaptation in transfer learning and the introduction of three technologies

从目标检测到图像分割简要发展史

黄鹤楼超震撼视角,这样的VR全景你绝对没见过!

年轻时代,噢,年轻时代
随机推荐
Care for front-line epidemic prevention workers, Haocheng JIAYE and Gaomidian sub district office jointly build the great wall of public welfare
淦,为什么 ““ .length !== 3 ??
如何创建一个有效的帮助文档?
银行理财子公司蓄力布局A股;现金管理类理财产品整改加速
7/24 训练日志
给生活加点惊喜,做创意生活的原型设计师丨编程挑战赛 x 选手分享
Register carefully! The number of applicants for these double non-governmental institutions exceeded 10000!
Visual model network connection
VC/PE正跑向青岛
11.2-hj86 find the maximum number of continuous bits
项目:串口接收—ram存储—TFT显示(完整设计)
Osmosis通过与Axelar和Moonbeam的集成将跨链足迹扩展至波卡
《21天精通TypeScript-4》-类型推断与语义检查
GDB help
什么是3DE体验平台
Common file operations
这届年轻人,为“丑东西”有多上头?
How to create an effective help document?
Typescript反射对象Reflect使用
【小程序开发】页面导航详解