2022 National Vocational College Skills Competition (Higher Vocational Group) "Software Testing" Competition Interface Test Task Book

Task seven interface test 

  1. Execute interface tests

This part performs the interface test according to the requirements; use the interface testing tool PostMan to write scripts, configure parameters, execute the interface test and take screenshots. The screenshots need to be pasted in the interface test summary report.

The specific requirements for interface testing are as follows:

Topic 1 : Script writing and execution test of asset statistical report query interface, and execute the script.

Preconditions: The role of asset administrator creates new assets into the database with the following data - asset name: test data, asset code: 765432.

(1) The asset statistics report query interface is described as follows:

Interface function: Provide statistical report query processing.

Interface address: http://192.168.1.251/asset/mobile/statistics.

Request method: POST.

Request parameters:

parameter

required

type

illustrate

statType

Ture

Int

Statistics by brand (default 3)

Response result:

  • "status":1,"msg":"The operation is successful!";
  • The rest fail.

(2) Description of interface test requirements:

  • Create a new Assertion script in Postman to test the asset list query interface;
  • Use the environment.set method in the Pre-request Script to set the environment variable, and the parameter name and parameter value are statType: 3;
  • Set KEY and VALUE in the script {Body} to receive request parameters;
  • In Tests, make an assertion judgment on the execution result, and set two assertions, ①judging that the response status code is 200, ②there is a "operation successful" character in the parameter value returned in the response content;
  • The setting is completed and the interface test is executed;
  • Screenshot requirements: There are 3 pictures in total, which are: ① Screenshot of the use case Body interface, which needs to include the interface submission method and URL; ② Screenshot of the use case Pre-request Script interface; ③ Screenshots of the use case Tests interface and Test Results interface.

Topic 2 : Script writing and execution test of asset statistical report query interface, and execute the script.

Preconditions: The role of asset administrator creates new assets into the database with the following data - asset name: test data, asset code: 765432.

(1) The asset statistics report query interface is described as follows:

Interface function: Provide statistical report query processing.

Interface address: http://192.168.1.251/asset/mobile/statistics.

Request method: POST.

Request parameters:

parameter

required

type

illustrate

statType

Ture

Int

Statistics by acquisition method (default 4)

Response result:

  • "status":1,"msg":"The operation is successful!";
  • The rest fail.

(2) Description of interface test requirements:

  • Create a new Assertion script in Postman to test the asset list query interface;
  • Use the environment.set method to set environment variables in Pre-request Script, and the parameter name and parameter value are statType: 4;
  • Set KEY and VALUE in the script {Body} to receive request parameters;
  • In Tests, make an assertion judgment on the execution result, and set two assertions, ①judging that the response status code is 200, ②there is a "operation successful" character in the parameter value returned in the response content;
  • The setting is completed and the interface test is executed;
  • Screenshot requirements: There are 3 pictures in total, which are: ① Screenshot of the use case Body interface, which needs to include the interface submission method and URL; ② Screenshot of the use case Pre-request Script interface; ③ Screenshots of the use case Tests interface and Test Results interface.
  1. Interface test report writing

According to the interface test situation, refer to the interface test report template, intercept the interface test script and result screenshots as required and paste them into the interface test report to complete the writing of the interface test report.

Guess you like

Origin blog.csdn.net/qq_50377269/article/details/131985903