GetXMLValueHandler function

GetXMLValueHandler function is used to get the specified value from Xml.

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 GETXMLVALUEHANDLER function. Provide xmlData and key to fetch the desired xml value.

For Example: We have a sample XML as given below:

Here we want to fetch the title which is Midnight Rain so the corresponding key will be As we get inside the hierarchy of the xml we will be using dot(.) for fetching the desired value along with the indexing (in case we have multiple entries for some data).

Once we have the data in the variable defined in element key you can use it in your further steps for validations or any other requirement that you have with this data.

After saving this function it will look as below:

Since, XML data are sometimes big we can first store that data in a variable and then we can use that variable in GETXMLVALUEHANDLER function as shown below:

Step 1: We have used a variable to store our XML data.

Step 2: Variable used in the above step is used as the input xmlData.

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

Was this page helpful?