Forum Discussion

agupta1's avatar
agupta1
Contributor
16 years ago

XPath Assertion

I want to add an XPath assertion that tries to validate against an expression. For example:

In Declare box I add the following XPath expression
//Count/text()

However, I want to validate this against (in the Expected Result box)
${Properties#UnreadMessagesCount} + 1

The above gives an error.

Is there any way, I can perform some calculation in the Expected Result box?

1 Reply

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Try the following:

    [tt:2xvi7nwd]${=${Properties#UnreadMessagesCount}+1}[/tt:2xvi7nwd]

    The ${= } causes the content to be evaluated as a Groovy script.