Forum Discussion

hafiz's avatar
hafiz
Occasional Contributor
17 years ago

Compare responses from actual service and a mock response

Hi there
    if anybody knows how we can compare (string comparison) the response comming from actual service to a mock service.

For some of tests i have a requirement to match actual reponse with existing response.

Thank you very much.
Hafiz

3 Replies

  • Hi Hafiz,

    How do you mean? Do you want to make two requests (to the real and mock services) and compare their results?

    regards,

    /Ole
    eviware.com
  • Hi,

    I  want to compare a XML-Respons with a stored XML-File.

    best regards
    berula
  • Hello,

    You can use groovy script to get response, load file and compare it.
    For example get response with:

    def request = context.testCase.getTestStepByName( "Test step name" );
    def response = request.getProperty( "Response").getValue();

    log.info( property ) // this is just to print it.


    Now, you can read file and compare it.

    Also, check : http://www.soapui.org/userguide/functio ... ystep.html


    robert