Compare Inputs

This is pre-built Action located under the @Generic Element Name. It instructs the Avo Assure Client to compare the inputs specified in the input Value (.xml and .json content) and save the differences in the 1st output variable and status (if the Action executed then saves the result as True, else False in 2nd output.

Syntax

Input: <Input Text (Original)>;<Input Text(Changed)> <Selective/All(Optional)>

Output: <Dynamic Variable>;<Dynamic Variable>(Optional)

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

Use case/Example

Scenario: Comparing Input Data for User Registration

In a web application that allows user registration, input data is submitted in JSON format. It’s essential to ensure that the input values match expected values to maintain data integrity before creating a new user account.

Input

A user submits their registration information via an API request in JSON format. You want to compare this input against expected values to verify accuracy.

Input Value Example:

Input JSON:

  {
      "Name": "Alice Johnson",
      "Email": "alice.johnson@example.com",
      "Password": "securePass123"
  }

Expected JSON:

 {
      "Name": "Alice Johnson",
      "Email": "alice.johnson@example.com",
      "Password": "securePass123"
 } 

Expected Result

The application should confirm that the values for Name, Email, and Password in the input JSON match the expected values.

Output

As the inputs in the above scenario are same, the {result} variable will contain the result of removed/added lines between the compared files and {status} variable will contain status as ‘True’, which can be utilized for display or other purposes. {result} variable will contain the result of removed/added lines between the compared files and {status} variable will contain status as ‘True’.

Last updated

Was this helpful?