Forum Discussion

Nita's avatar
Nita
Occasional Contributor
16 years ago

[SOLVED]Compare Response

How I can test whether the response for one test step is similar to that of another test step that runs later?

4 Replies

  • Buschfunk's avatar
    Buschfunk
    Frequent Contributor
    For this, you would first need to define the term "similar". What do you mean with that?

    Greetings,
    Robert
  • Nita's avatar
    Nita
    Occasional Contributor
    Both Responds should have identical SOAP Script.
    The situation is:
    Run one teststep1
    Got the response1(some listing)
    Run test Step2(to update list)
    Got the response2( updation failed)
    Run test Step3(to get the same listing)
    Got the response3(should get the same listing)

    So I need to compare response 1 and response 3
  • Try do this from  groovy after run step1 and step2:

      def responseStep1 = context.expand( '${Step1 name#Response}' )
      def responseStep2 = context.expand( '${Step2 name#Response}' )

      if (!responseStep1.equals(responseStep2) )
          testRunner.fail("Responses is not equal")
  • Nita's avatar
    Nita
    Occasional Contributor
    I could compare the responses successfully.Thank You Tom_13