Skip to content

JsonCompare function

SONCompare function is used to compare two 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 JSONCOMPARE function. Provide both the JSONs.

If both the JSON are found equal it will return true else it will return false in a variable defined in Element Key.

After completing the step it will look as below:

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

Step 1: Setting up a variable and storing JSON in that variable.

Step 2: Setting up another variable and storing JSON in that variable.

 

Step 3: Using variables in the JSONCOMPARE function.

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

Back To Top