Forum Discussion

Sandyapitester's avatar
Sandyapitester
Frequent Contributor
8 years ago

How to compare two testcase value in soapui pro ?

Hi All,

 

Need to compare the two test cases request and response value in SOAPUI PRO

 

 

Ex:

 

Testcase 1 : am passing some value in request parameter in POST method

 

Testcase 2 : am getting the same value in GET request 

 

Quest I need to compare the two value 

 

 

Like 

 

Testcase 1 : Request am passing Json parameter 

 

[{
"Name": "Steve",
"Number": "12345",
"IdcardNo": "0000111",
}]

 

Testcase 2 : am getting the response same parameter value like 

 

[{
"Name": "Steve",
"Number": "12345",
"IdcardNo": "0000111",
}]

 

Now  need to compare Testcase 2 response value is matching with Testcase 1 request value

 

Please guide me how to fix this issue or if u have sample groovy script it would be more helpful

 

Note: SOAPUI PRO - Testcase 2 Any assertion if am trying to match 

am unable to find the Testcase 1 raw request

 

 

 

 

 

 

1 Reply

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Sandyapitester,

     

    I think that you can compare the values by using any JSON assertions. Have you tried this approach? 

     

    Judging by this data:

    [{
    "Name": "Steve",
    "Number": "12345",
    "IdcardNo": "0000111",
    }]

    I suppose you will need to send different data to your service. In this case, I suggest that you create Data Source in your project to keep all data there. In your request, you can simply add the values from the Data Source. Please refer to the following article for more information:

    http://readyapi.smartbear.com/structure/steps/data/source/start