Forum Discussion

Usha_Kodali's avatar
Usha_Kodali
Frequent Contributor
15 years ago

comparison of two responses

Hi,

I have following scenario:

Run tests and save the response, test name and test status to DB or to a folder in a XML format.
While doing regression testing, with the same input parameters execute the request and verify what changes have occured to current response. In the sense compare two responses. If there is no change dont do anything. If there are changes in Data/element save them to a file.

How can I achieve this using groovy?

This is urgent! So please help

1 Reply

  • Finan's avatar
    Finan
    Frequent Contributor
    First you have to obtain the response and store it:
    To obtain the response use something similar to this:
    def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
    def holder = groovyUtils.getXmlHolder(testRunner.testCase.testSteps["testStepName"].testRequest.getResponseContent());


    Then you have to write the XML to your file or DB.