Question

I have captured my input id in a property and now i want to validate if the property has data or not. How to do this? I have done something like this:

This is my property that i have set:

<property xmlns:cct="http://www.tempuri.org/" name="ID" expression="//cct:ID" scope="default" type="STRING"/>

This is my xpath xpression that should validate if property has data or not:

count(get-property(ID)[text()])>0

But this expression is wrong. How to solve this. Please help. Thanks in advance

Was it helpful?

Solution

Change your property to this:

<property xmlns:cct="http://www.tempuri.org/" name="ID" expression="//cct:ID/text()" scope="default" type="STRING"/>

then test using

boolean(get-property('ID'))

OTHER TIPS

It should be something like below,

count(/property[@name='ID']/text())

Note that the correct path (instead of /property/..) depends on your xml. you may also use /*/property/... if not sure about the path.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top