Forum Discussion

Vaidas_Adomausk's avatar
Vaidas_Adomausk
New Contributor
17 years ago

How automatically compare response data with database data?

Hi,

I am quite new to SoapUI and I am testing web services which add/edit data in database. How I could automatically compare response data and data in database to make sure that web service works correctly.

Example scenario1:
Requirement: WebService generates random string, records it to db and returns it as response.
In test I would like:
Call webService and get response (new generated string)
Check if response from webService (new generated string) is actually in DB (if programmer added it correctly to db).

Example scenario2:
Requirement: webservice edits data for defined ID.
In test I would like:
call webService with ID as input and get response changed data for that ID (e.g. number, if i want to increase it with every call)
check if response from webService (the number) is the same as in DB (was changed in db too).

Thanks for tips in advance.

Vaidas

1 Reply

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Vaidas,

    you should be able to create DataSource steps for each situation that select the corresponding from the DataBase (using JDBC). After that a simple groovy script for comparing the result with the value in the database should do the trick..

    Hope I understood you correctly, please post again otherwise :-)

    regards,

    /Ole
    eviware.com