"GET_REST_VALUE" Command

Description: This command retrieves a value from the response received from a call to a REST end point which can be used anywhere in your test case.

Usage Scenario: Suppose we want to get some information from the response about a profile by entering its ID number.

Procedure: Define a step with Get_Rest_Value which contains exactly which data you are trying to retrieve in JSON. For exmaple, to retrieve the first name of a user, we can use "firstName”. To identify which user the request is sent for, you can use a variable to store the user ID in a Set_Var step which starts before Get_Rest_Value step. The same variable name needs to be in the REST Connection URL field.

REST Connection URL example where @id uses a variable defined in a Set_Var step

image-20240605-152229.png

Your steps will look like this:

image-20240605-152303.png

See the Test Library path: subject7_samples/subject7_intermediate_suite/subject7_get_profile_by_id_using_rest