Forum Discussion

gaurkhurana's avatar
gaurkhurana
Occasional Contributor
10 years ago

Matching expected response with actual of a data driven test within SOAP UI Pro

Hi,

 

I have a data driven test that takes 5 different values for the same request. Each of these 5 requests have a different response. I want to add assertion in SOAP UI Pro to match the actual response with the expected response for each of these 5 responses. Is there an easy way to do it?

I dont want to store the actual response in some ecel and then do comparison.

4 Replies

  • The easiet way I could think of is create a data source test step to return a list of input values and expected output and use the same in input parameter and output assertion. 

     

    Example DataSource

     

    Input, ExpectedOutput

    ipA, expOutputA

    ipB, expOutputB

    ipC, expCoutputC

    ... and so on 

     

     Then replace input parameter data in test step with value ${DataSource#Input} and assert value in output as  ${DataSource#ExpectedOutput}

     

    insert a DataSource Loop test step at the end of the test step to run your test case for all inputs/expected output values in DataSource.

     

    Good Luck,

     

    Regards,

    Gilu Gopi

    • gaurkhurana's avatar
      gaurkhurana
      Occasional Contributor

      Thanks for the response. I tried this but my assertions are keep getting failed. I am not able to get the reason for the failure.

      I have the following steps

       

      Step 1 - Data source (Grid) with 2 columns, input and output

      Step 2- Request XML with one of the fields paramaeterized iwth the input data source like ${Dataource#input}

      Step 3 - XPATH assertion with expected response as ${DataSource#output}

      Step 4 - Data Source loop pointing to the data source in Step 1 

      • gilugopi's avatar
        gilugopi
        Contributor

        Please send more details

         

        1. input xml

        2. output xml

        3. Xpath for assertion