Forum Discussion

qrkkarnis's avatar
qrkkarnis
New Contributor
14 years ago

Validate XML Response Message in Groovy

Hi,
I have a question. Can we validate the SOAP response against Schema (i.e. get the result that element x is missing in XML resposne) in Groovy like in the Request Window (right click on the response view of XML and click validate - the result will appear below) and get the result in Groovy?

Thanks for answer,
BR
  • Hi,

    I didn't got your question correctly. However will go by my understanding on it.
    - Response validation can be done using "Schema Compliance" assertion in a teststep.
    - Using groovy you can get the status of the same Assertion & log the required information.

    Hope this helps.
    Best Regards
    {Pradeep Bishnoi}
    http://learnsoapui.wordpress.com
  • qrkkarnis's avatar
    qrkkarnis
    New Contributor
    Thanks for the reply.

    That is the answer I've been searching for. Thanks

    But there is another problem that arised - I would like to continue with the test steps even if the Schema Compliance assertion will fail. But now, if the assertion fails, all test case stops running. I only need to log the schema compliance assertion result and allow test case to continue working.

    Have anyone an idea?