Supported Functions Reference

Use these functions to combine, format, or aggregate values extracted from an XML automation result file. Functions can simplify mapping expressions and eliminate the need for custom preprocessing of XML data.

Function

Purpose

concat()

Combines two XML expression values into a single string.

groupConcat()

Combines multiple values returned by an XML expression into a single string.

concat()

Use concat() to combine two XML values with an optional separator.

Syntax:

concat(expression1, expression2, separator, strict)
Table 56. Parameters

Parameter

Description

expression1

The first XML expression.

expression2

The second XML expression.

separator

Text inserted between the two values.

strict

Controls how missing values are handled.



Strict Parameter Values

Table 57. Strict Parameters Values

Value

Result

true

Returns an empty value if either expression cannot be resolved.

false

Ignores missing values and concatenates the available values.



Example 53. XML
<testsuite name="Operator">
    <testcase name="Add"/>
</testsuite>

Expression

concat("${testsuite:name}", "${testsuite.testcase:name}", "#", true)

Result

Operator#Add



groupConcat()

Use groupConcat() when an expression returns multiple values.

Syntax

groupConcat(expression, separator, strict)

Parameters

Table 58. Parameters

Parameter

Description

expression

XML expression that returns multiple values.

separator

Text inserted between each value.

u

Controls how missing values are handled.



Strict Parameter

Table 59. Strict Parameters

Value

Result

true

Returns an empty value if no matching values are found.

false

Concatenates all available values.



Example 54. XML
<testsuite name="Operator">
    <testcase name="Add">
        <error>Value must not be null</error>
        <error>Value must be greater than 0</error>
        <error>Value must be numeric</error>
    </testcase>
</testsuite>

Expression

groupConcat("${testsuite.testcase.error}", ";
", true)

Result

Value must not be null; Value must be greater than 0; Value must be numeric



Note

  • Use concat() when you need to combine two known values.

  • Use groupConcat() when an expression can return multiple matching elements.

  • Select an appropriate separator to improve readability (for example, -, #, , , or ; ).

  • Use strict=true when all input values are required.

  • Use strict=false when missing values are acceptable.

Common Use Cases

Table 60. Use Cases

Scenario

Recommended Function

Create a unique test case name

concat()

Combine test suite and test case names

concat()

Build a descriptive summary

concat()

Merge multiple error messages

groupConcat()

Combine repeated XML element values

groupConcat()



Publication date: