Writing Response Schema

Your guide to knowing how to write a response schema

The Following is the process to Write a Response Schema

First Click on the 3 dotted icon and click on the NEW.

Give Name and Match String as per the requirement.

  • Name - Here we give the name that is related to response body.

  • Match String - Here we give the any Key parameter of the response body which should be as it is in the response body.

Click on the three dots and Select the Name value that you have given and save the data.

The lower sections it derived in five elements Response Field value, DataType , Assert Operation, Assert Data and Product Element(optional).

Response Field Value - This is to map the Key parameter in the Response Body, in other words here we are locating the element in the response body so that we can check that if it is equal to the input element that we have given in the request template.

Data Type - This depends on the value parameter i.e. if it is an numerical value we use Integer, if it is Alphabets we use String as data type, if it is true or false then we use Boolean as Data Type.

Assertion Operation- Here we give the operator based on the requirement such =, >=,<,> for the Integer data type, and for string data type we use equals, Stringlength= e.t.c.

Assert Data- There are two ways to Assert the data.

  • By Parameterized Product Element - Here we give ${Productelement} in this format which was parameterized in the request which helps to check the data from the response is equal to the request that had given from the default param.

  • By Giving Raw Data - Here the expected data will be given. for example if we take statusCode in API Header we expect the outcome as 200, so we can type 200 as the outcome.

Product Element - This is for filtering the data in the output that needed. For example, in the response it has 40 lines of data but if checked only 2-3 lines of data shown, by giving product element of selected data it can acquire required data output.

Last updated