javiermartin
12 years agoNew Contributor
Assert xml empty-element
I need to assert by XPath match an empty xml element or a JSON respons without anything.
The xml tab shows this:
<Response xmlns="http://....................">
<booksNotRefunded/>
<booksRefunded>
<e>9788401383403</e>
</booksRefunded>
<email>xxxxxx@xxxxxxx.xxx</email>
</Response>
And JSON tab shows this:
{
"booksRefunded": ["9788401383403"],
"booksNotRefunded": [],
"email": "xxxxxx@xxxxxxx.xxx"
}
I want use 3 assertions:
1.- Response code 200. it's ok
2.- booksRefunded exists and has information
3.- booksNotRefunded exists and hasn't information (here is the problem, because i don't know how to do this XPath Match assertion)
Somebody can help me????
Thanks
The xml tab shows this:
<Response xmlns="http://....................">
<booksNotRefunded/>
<booksRefunded>
<e>9788401383403</e>
</booksRefunded>
<email>xxxxxx@xxxxxxx.xxx</email>
</Response>
And JSON tab shows this:
{
"booksRefunded": ["9788401383403"],
"booksNotRefunded": [],
"email": "xxxxxx@xxxxxxx.xxx"
}
I want use 3 assertions:
1.- Response code 200. it's ok
2.- booksRefunded exists and has information
3.- booksNotRefunded exists and hasn't information (here is the problem, because i don't know how to do this XPath Match assertion)
Somebody can help me????
Thanks