Updated on 2023-03-14 GMT+08:00

Setting Response Extraction

Response extraction is to extract a part of the API response result and name it as a parameter for invoking in subsequent test steps. Response extraction needs to be defined in the previous test steps and used in subsequent test steps.

  • In the previous test steps, create the parameters to be passed on the Response tab page. Built-in parameters are used for response extraction. For details, see Built-in Parameters. Response extraction also supports regular expression matching and extracts the return value that matches the given regular expression.
  • In subsequent test steps, use ${parameter name} to reference the response extraction created in the previous test steps. This parameter can be referenced in the URL, request header, and request body in subsequent steps. If this parameter is referenced in the request body in JSON format, enclose the parameter with quotation marks. For example:
    id: "Test case ID"

  • The response extraction function can obtain strings based on the specified key:value. For details, see Example: Obtaining a String from the Response Body Based on the Specified key:value.



    Output Parameter

    ${Output Parameter}, which will be referenced later. The name consists of letters, digits, and underscores (_).


    Source of the detected field, such as the response body (JSON), response header, and response code.


    • If the source is a response code, this parameter can be left empty. For details, see Response Code Check.
    • If the source is a response header, the property is the name of the field in the response header. For details, see Response Header Check.

    Advanced Extraction Type

    (Optional) Use the advanced extraction type to assist in extracting response information. If N/A is selected, no additional matching mode is used.

    Currently, there are two modes:

    For the advanced extraction type, the string extraction function is preferred. If the function cannot meet the requirements, you can use the regular expression.

    Assign Value to Dynamic Environment Parameter

    Assigns the value extracted from the response to the dynamic parameter so that the dynamic parameter can be referenced in subsequent tests.