Unable to get value from xml (response)

Hi All, could you please help

I got following kinds of response of API.












... ...

But when I use following method to get the value
WSBuiltInKeywords.verifyElementText(response, ‘mainResult .Row[3].ItemNumber’, ‘345158’, FailureHandling.OPTIONAL)

I got following result:
PM - [WARNING] - Expected text is ‘345158’ but actual element text is:

Seems like that the text value is not get.

I’m not sure the element locator is correct or not. Any suggestions?

The response contains

Is there any way that can get the count of this element ? So i can write loop case.

Thanks & Regards !

This post may help

This post is talking about accessing response in HTML. Accessing XML response might be similar, but I have never tried yet.

1 Like

Thanks kazurayam,
Finally I wrote a customer keyword to convert the responseText into xml and get the tag values. I’m not sure whether is an easy way to do this.

1 Like

Good to hear your success.

Just for your interest, I have ever develop a custom keyword to extract texts in HTML and return them as an instance of java.util.List

1 Like