Set tag value

This is a pre-built Action located under the WebService Element. The functionality of this Action in Avo Assure is to set the value of a specific tag (XML or JSON tag value) within the request body of the WebService. The result of this Action updates the request body dynamically for further use during test execution.

Syntax

Input Value: Tag Value

circle-info

Supported Input Formats:

  • Text: Plain string input.

  • Static Value: A fixed value that you manually provide.

  • Dynamic Variable: Value retrieved from a previously stored output variable.

Argument
Description

Tag Value (Required)

Enter the value that needs to be assigned to the specified tag in the Webservice request body.

Output Value: N/A

Argument
Description

N/A

Not Applicable

circle-info

Note: To use the Set tag value action, drag and drop the Webservice element from the Element Repository to the Test case. The Element Name, Action (Keyword), and Input Value fields display automatically. The Set tag value action becomes available at the Test case level only after the element is added.

Example 1: Setting a Tag Value in a Webservice Request

In this example, we explain how to update or insert a JSON tag value in a Webservice request body.

  • Action: Set tag value

  • Input Value: John

    • The input value (John) specifies the value that is assigned to the JSON tag.

    • The action updates or inserts the first_name tag in the Webservice request body with the provided value.

  • Output Value: N/A

    • This action does not require any output value.

  • Logical Explanation: The Set tag value action takes the value from the Input Value column (John) and assigns it to the first_name JSON tag in the Webservice request body. This action modifies the request body directly.

Example 2: Setting a Tag Value Using a Dynamic Variable

In this example, we explain how to set a JSON tag value using a dynamic variable.

  • Action: Set tag value

  • Input Value: {FirstName}

    • The input value ({FirstName}) specifies a dynamic variable that stores the value to assign to the JSON tag.

    • The action retrieves the value stored in the {FirstName} variable and assigns it to the first_name tag in the Webservice request body.

  • Output Value: N/A

    • This action does not require any output variable.

  • Logical Explanation: The Set tag value action takes the value from the Input Value column ({FirstName}). It fetches the value stored inside the dynamic variable and assigns it to the first_name JSON tag.

circle-info

To know more how to create a dynamic variable in Avo Assure, click here.

Example 3: Setting a Tag Value Using a Data Parameterized Value

In this example, we explain how to set a JSON tag value using a data parameterized value from a data source.

  • Action: Set tag value

  • Input Value: |FirstName|

    • The input value (|FirstName|) specifies a data parameterized field that retrieves its value from an external data source (such as Excel, or Data Table).

    • The action reads the corresponding value for the current iteration and assigns it to the first_name tag in the Webservice request body.

  • Output Value: N/A

    • This action does not require or store any output variable.

  • Logical Explanation: The Set tag value action takes the value given in the Input Value column (|FirstName|). It gets the data (John) from the data source. Then, it sets that value to the first_name JSON tag in the request body.

circle-info

To know more how to do Data Parameterization, click here.

Example 4: Setting an XML Tag Value Using a Static Value

In this example, we explain how to set an XML tag value using a static (hardcoded) value.

  • Action: Set tag value

  • Input Value: John

    • The input value (John) specifies a static value entered directly in the Input Value column.

    • The action assigns this fixed value to the OrderRequest/Customer/first_name XML tag in the request body.

  • Output Value: N/A

    • This action does not require or store any output variable.

  • Logical Explanation: The Set tag value action takes the value from the Input Value column (John) and assigns it directly to the specified XML tag (OrderRequest/Customer/first_name).

Last updated

Was this helpful?