H
H
Hermann Demin2021-06-14 01:15:28
JavaScript
Hermann Demin, 2021-06-14 01:15:28

Postman how to write tests for xml response?

Greetings!

Could you tell me how to check for xml response?
Let's check for the presence of a tag or its absence?
The off documentation has a lot of examples for json, but nothing for xml.
I've learned how to parse and write certain values ​​to collection variables, but I can't get any further than that.

If you can tell me where I can read about it, I will be extremely grateful.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2021-06-14
@germann_vladivostok

Unfortunately, postman does not provide a document.evaluate function that allows you to make xpath queries.
Therefore, xml is first converted to json with:
var jsonObject = xml2Json(responseBody);
And js is already tested

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question