Forum Discussion

Slimy37's avatar
Slimy37
Occasional Contributor
15 years ago

responseAsXml not being returned

I have a web test case that interrogates a series of web pages, passing parameters from one to the next using Groovyscript. The first page works, and returns a 'responseAsXml', which is then parsed with Groovy to get the next set of values. These values work for the second page, and I have a copy of the same Groovy to parse those values and pass them to the third page.

Unfortunately, while the first page (a HTTP GET) returns a 'response' as well as a 'responseAsXml', the second page (a HTTP POST) only returns a 'response'. The response can be viewed as XML, and is almost identical to the first page in form and content.

Is there any reason why the first page returns an xml response but the second doesn't? Is it because the first page is a GET response, whereas the second is a POST response?

Alternatively, this is what I'm using to get the parameters out of the web pages;

viewstatetemp=context.expand( '${Step 2#ResponseAsXml#//div[@id="pagecontent"]/form/input[@name="__VIEWSTATE1"]}' );

What would be it's equivalent using just response? I did try the obvious, but just removing the 'AsXml' bit didn't work. I'm guessing because the 'response' part isn't XML the whole XQuery string doesn't work.

I'm using soapUI 3.6.1 standard.
  • Slimy37's avatar
    Slimy37
    Occasional Contributor
    OK, found the issue. The responseAsXml is being returned, it's just the properties box couldn't display it. Doing a property transfer to a property that I could then copy and paste showed that the response is actually coming back.

    The problem I had with the XQuery failing was the developers slipping in an extra line of XML, so the tags didn't match between screens. So much for consistency, I guess it's something us testers just have to cope with...