Forum Discussion

skillsoft's avatar
skillsoft
Frequent Contributor
15 years ago

Xpath assertion that contain more than 1 match

It would be good to have the ability to be able to create an XPath Assertion that has more than one match.  For example:

Say I have a response that contains about 15 Field element.  4 of the Field elements have a Label attribute value that contain the common string "label" (label1, label2, label3, label4)

The following would return all 4 elements:

declare namespace ns2='http://skillsoft.com/Hapi/WebService';
//ns2:getUserStatInfoResponse[1]/return[1]/SkillPort[1]/BaseSite[1]/UserStatFields[1]/Field[contains(@Label,"label")]

I'll just create seperate assertions for this, so I can work around it. Currently you can only have one match for an xpath assertion. 

Thanks,

Mary