Xpath Match by ChildNode
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Xpath Match by ChildNode
Hi, I'm trying to dev a test to assert if API response returns the same child nodes that I'm looking for. Since the info that I'm looking for doesn't return as value but child nodes, I need to match them with element names.
<Root> <Child1Parameters>...</Child1Parameters> <Child2Parameters>...</Child2Parameters> <Child3Parameters>...</Child3Parameters> <Child4Parameters>...</Child4Parameters> </Root>
So as in the example, I want to check if Root element has "Child1Parameters", "Child2Parameters", "Child3Parameters" and "Child4Parameters" nodes.
Do you know how can I do this?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
am I misunderstanding? the way I read this it sounds like you are asking to just assert the presence of the XML instance's elements or do you mean something different?
if you just need to assert the presence of specific tags within the response, wouldn't an existence check be what you need?
ta,
rich
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @hincal, was the advice from the Community helpful?
nmrao, richie – thank you!
Sonya Mihaljova
Community and Education Specialist
