Article Directory
- 1. Interface management
- 2. Scene management
1. Interface management
1. New interface
Interfaces can be added via 手动添加
or . 批量导入
Batch import supports apipost, apifox, postman and other data sources.
2. Set request parameters (same as ApiPost)
Header
: Header parameters can be set or imported, and cookies are also set in the Header;
Query
: Query supports the construction of URL parameters, and supports RESTful (introduction) PATH parameters (such as: id); :
Body
Body provides three types of form-data / x-www -form-urlencoded / raw , each type provides three different UI interfaces:
1) When submitting a form, switch to x-www-form-urlencoded
2) When submitting a form with files, switch to form-data
3) When sending JSON objects or other objects, switch to the corresponding raw type
认证
: Supports four authentication methods: private key-value pair, Bearer auth, Basic auth, and Digest auth; :
断言
Supports three assertion methods: response header, response body, and response code;
关联提取
: Supports two extraction forms: json extraction and regular extraction;
接口设置
: Can be set Whether to follow redirects, the number of times to follow redirects, the request read timeout limit, and the response read timeout limit.
3. Set global variables
Set the variable name and variable value in the global variable, and the scope is within the current team. The calling method of the global variable is to use two {
{}} to refer to the variable name, such as: {
{变量名}}
. After setting, the variable can be referenced at the interface URL or the request area.
4. Public functions
Commonly used functions are as follows:
5. Environmental management
After setting the environment variable, it can be directly used in the front URL of the interface.
6. Response area
The response area includes: real-time response, request header, request body, response header, assertion result, and extraction result.
The returned data is in beautification mode by default, which is convenient for viewing JSON XML format. You can view other types of types by toggling "native" mode.
2. Scene management
1. Create a new scene and import an interface
1. Establish the scene to be tested, and input the scene description as required. RunnerGo connects the interface to be tested in a flow manner and conducts the test from top to bottom.
2. Click [Import Interface] at the bottom of the scene canvas, and you can see the interface you created in "Interface Management" in the "API Adder" on the right. You can quickly check the interface that needs to be tested, and copy the interface to be tested to the scene.
2. Create a new interface in the scene (not synchronized to interface management)
3. Add waiting controller
Insert a wait time between process configurations, up to 60s.
4. Add a conditional controller
Judging whether a variable satisfies a certain condition, thereby determining whether the interface of the controller is running. It can be judged by the value extracted from the previous interface, a certain value returned or other values.
5. Scene interface debugging
1) Click the "Start Debugging" button in the upper right corner of the scene to debug all the interfaces in the scene (green if passed, red if not passed, and unchanged if not executed); 2) After debugging the scene, click "View Results" in the
interface " button to view the results returned by a single interface in the scene;
3) Click the "..." button in the upper right corner of the interface and select "Edit Interface" to perform single interface debugging;
6. Interface weight
The interface weight refers to the percentage of the concurrent number. As shown in the figure below: the precondition concurrency number is 500 . 登录随机值
The interface weight is 100, and 首页
the interface weight is 80. Since there is no interface on the upper level of these two interfaces, the concurrency of the random value interface is 500, and the concurrency of the home page interface is 400; since the right interface has a weight of 80, 注册副本
then We take the maximum concurrency number of its upper-level interface as 500 as the standard, then its concurrency number is 400, and its lower-level 登录
interface (right side), since the weight is 50, the weight of the login interface is equal to: 400*0.5= 200 concurrency.
7. Interface mode
Four modes are supported: default mode, error rate mode, response time mode and replies per second mode.
error rate mode
Test objective: the error rate of a single interface in the scenario.
Function: If an interface in the scenario exceeds the set error rate threshold, the plan will automatically stop; if the error rate does not exceed the error rate threshold after reaching the maximum number of concurrency, it will continue to run for the set duration of stable duration and then end the plan. plan.
response time mode
Test objective: According to the response time of all interfaces in the scenario, the response time of each interface is compared with the set threshold.
Function: If one of the interfaces exceeds the set threshold, the number of concurrency will no longer increase, and the plan will end after running for the set duration of stable duration; if the set threshold is not reached after reaching the maximum number of concurrency, Then continue to run for the duration set by the stable duration and then end the plan.
replies per second mode
Test target: Number of interfaces sending and responding per second (RPS). Calculation method: RPS = total number of requests on the interface * concurrent number of interfaces / total response time, which is approximately equal to: concurrent number of interfaces / average response time (s).
Function: When the RPS is greater than the set threshold, the number of concurrency will increase to the maximum number of concurrency, and when it is less than the threshold, it will gradually increase according to the setting.
8. Scene settings
Add a parameterized file at the uploaded file. The first line of the parameterized file is the variable name, which is "comma-separated" in English. Add a variable with a fixed value at the variable. The files and variables added here can be referenced in the interface of the scene. {
{***}}.