Xpath assertion that contain more than 1 match
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2009
03:11 AM
10-16-2009
03:11 AM
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
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
4 REPLIES 4
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2009
03:12 AM
10-16-2009
03:12 AM
Hi Mary,
you're right.. currently you can use the XQuery assertion instead which supports this scenario.
regards!
/ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
you're right.. currently you can use the XQuery assertion instead which supports this scenario.
regards!
/ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2019
01:05 AM
03-06-2019
01:05 AM
Hello @skillsoft
Could you tell me how I could add an XPath that says:
Response contains > 10 answers, not knowing what the answers are but one is expecting more then 10?
Thanks in advance,
Kind regards,
AboveAndBeyond
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2019
09:19 PM
03-07-2019
09:19 PM
May be you could consider creating a new thread with specifics of the use case along with sample data.
Regards,
Rao.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2019
05:30 AM
03-14-2019
05:30 AM
For future reference:
The last question is discussed here:
---------
Tanya Yatskovskaya
SmartBear Community and Education Manager
Tanya Yatskovskaya
SmartBear Community and Education Manager
