pricedgp
10 years agoContributor
Using properties in XPath match expressions
I'm trying to do an assertion on a block of text that's returned in a response, using regex expressions -- specifically, while also using property values. I'm using the XPath Match Configuration window to do this.
For example, I have a property value called "hcc_name", and I can do an assertion on an XPath expression like this, which DOES work:
matches( //ns2:realTimeTransactionResponse[1]/COREEnvelopeRealTimeResponse[1]/text(), '${hcc_name}' )
However, when I try to combine that property value with other text before and after that value in that line, it DOES NOT work. For example, I'd like to be able to match against ABC${hcc_name}.
I've tried various combinations, such as:
'ABC' + '${hcc_name}'
'ABC${hcc_name}'
'ABC' + ${hcc_name}
'ABC\${hcc_name}'
'ABC\$\{hcc_name\}'
Is concatenation not supported? If not, does anyone have a better way to do this?
Thanks.
For example, I have a property value called "hcc_name", and I can do an assertion on an XPath expression like this, which DOES work:
matches( //ns2:realTimeTransactionResponse[1]/COREEnvelopeRealTimeResponse[1]/text(), '${hcc_name}' )
However, when I try to combine that property value with other text before and after that value in that line, it DOES NOT work. For example, I'd like to be able to match against ABC${hcc_name}.
I've tried various combinations, such as:
'ABC' + '${hcc_name}'
'ABC${hcc_name}'
'ABC' + ${hcc_name}
'ABC\${hcc_name}'
'ABC\$\{hcc_name\}'
Is concatenation not supported? If not, does anyone have a better way to do this?
Thanks.