Forum Discussion

MartinSpamer's avatar
MartinSpamer
Frequent Contributor
13 years ago

Contains Assertion

I have a REST request test step. It includes a number of Assertions. I want add an Assertion to ensure the response correctly opens with :

<?xml version="1.0" encoding="UTF-8" ?>


This does appear as expected in the "Raw Response", but is not shown in the "XML Response". This seems odd to me that, because it should clearly be considered part of the content.

I tried using an Contains Assertion but this doesn't detect this tag.

I guess I could use a Groovy to access the raw response but wonder how this is supposed to be done, what is the official way.

-- edited for grammar & clarity --

1 Reply

  • Aaronliu's avatar
    Aaronliu
    Frequent Contributor
    Hi,
    it seems won't contain declaration of XML head tag in XML response. The Raw response is because it will keep original pattern rather than parse it. in soapui, the xml response have already encapsulated using SOAP protocol. so you just saw that <soap-envelope> in head of xml. Actually, if you copy a piece of xml with <?xml version="1.0" encoding="UTF-8" ?> in request, after you format the request, the tag will be disappeared as well. so if you would like to check this tag, maybe need to switch to another format of view.