If I want to get the value of an element in karate, I can use "response //RecordA/RecordSequence". How to get the same value in a function using below approach. I have tried .getElementsByTagName, .find and karate.get but it does not work under a function to find a specific value based on tag. Any help appreciated to find value based on tag under function.
Background:
* def myxml =
"""
function(tags)
{
var xmlValue= tags.getElementsByTagName("RecordA"); // Getting error as
.getElementsByTagName is not supported
return xmlValue;
}
"""
Given request
when soap action ''
Then status 200
* def resxml = response
* def myresult= myxml(resxml)
And assert result100 = '<expected_desc1>'|| result100 = '<expected_desc1>'