Compare Inputs
This is pre-built Action located under the @Generic Element, instructs the Avo Assure to compare the inputs specified in the input Value (.xml and .json content) and save the differences in dynamic variable.
Syntax
Input Value: <Input Text(Original)>;<Input Text(Changed)>;<Selective/All(Optional)>
<Input Text (Original)>
(Required)
Provide original input you want to compare against.
<Input Text (Changed)> (Required)
The new or expected text value that you want to be compared.
<Selective/All(Optional)> (Optional)
Optional comparison mode: • All → compares the entire text exactly • Selective → compares only specific parts
Output Value:
<Dynamic Variable> (Required)
This variable holds the result of the content comparison.
<Dynamic Variable> (Optional)
This variable stores the status as true or false
Note: Outputs for compare files and compare Inputs are as follows:
JSON and text:
- If a line is removed from the first input
+ If a line is added in the second input
? shows the delta (difference) of the two files
xml: \ tags will be there with the following params:
diff:update-attr – XML attribute is updated
diff:delete- line deleted
diff:insert- line inserted
diff:delete-attr- attribute deleted
diff:add-attr- XML attribute added
Example
Compare two input texts and highlight differences The Compare Inputs action takes the value from the Input Value column (e.g., {"name":"Alice","age":30,"email":"[email protected]"};{"name":"Alice","age":28,"email":"[email protected]"};all) and compares the original input text with the changed input text. The result of the comparison is stored in the {Comparison} variable, and the action status is saved in the {Status} variable with the following possible values:
True – if the inputs are compared successfully
False – if the inputs are not compared

Note: After executing the Test Steps you can see the result in the Avo Assure Client console.

Last updated
Was this helpful?