Skip to content

GetJSONValueHandler function

GetJSONValueHandler function is used to  get the specified value from JSON.

Select SET command from the action dropdown and provide a variable name in Element key, edit parameter section and click on Form, select functions from the dropdown and select GETJSONVALUEHANDLER function. Provide jsonObject(JSON data) and key to fetch the value from the given json.

For Example: We have a sample JSON as given below:


Here we want to fetch the name which is JSESSIONID so the corresponding key will be As we get inside the hierarchy of the JSON we will be using dot(.) for fetching the desired value.

Once we have the data in the variable defined in element key you can use it in your further steps for validations or any other requirement that you have with this data.

After saving this function it will look as below:

Since, JSON data are sometimes big we can first store that data in a variable and then we can use that variable in GETJSONVALUEHANDLER function as shown below:

Step 1: We have used a variable to store our JSON data.

Step 2: Variable used in the above step is used as the input JSON object.

Step 3: Verifying the actual value and the expected value.

Back To Top