Get Block Value

This is pre-built Action located under the @Generic Element, instructs the Avo Assure to fetch the value of the XML block and save the result in the given dynamic variable.

Syntax

Input Value: <XML tag name>;<index of block name>;<block name>

Argument
Description

<XML tag name> (Required)

<index of block name> (Required)

<block name> (Required)

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

Usecase/Example

Scenario: Fetching Values from XML Blocks in API Testing

When you are testing a financial services API that returns a user's transaction history in XML format. It's important to verify that not only the correct number of transaction blocks is returned, but also that the values within those blocks are accurate.

Consider that you send a request to the API to retrieve the latest 4 transactions for a specific user and want to extract specific block values from the XML response. In this scenario user wants to fetch the value of 2 child blocks from parents block by providing parents block name.

Retrieves the value of a specific tag from a selected block within the XML structure The Get Block Value action takes the value from the Input Value column (e.g., Name;2;User) and extracts the value of the specified XML tag (Name) from the block (User) at the given index (2). The result of the extraction is stored in the {BlockValue} variable, while the execution status is stored in the {Status} variable, with the following possible values:

  • True – if the tag value is successfully retrieved.

  • False – if the extraction fails or an error occurs.

Input

Using the Action:

You will use the get value Action to extract specific values from the XML blocks, such as the 2 transaction blocks.

Expected Result

This Action needs to retrieve two child blocks from the desired parent block by providing parents block name.

Output

The result of this Action is stored in the {result} output variable

Last updated