Forum Discussion

jdeane's avatar
jdeane
New Contributor
15 years ago

newbie question - apologies if it is obvious!!!!

I am just getting to grips with SOAPUI with my goal to use it mainly for Web Service functional testing in our SOA development environment.

I can see how we may test the Web Services on their own to ensure that the response payloads are correct given a known input payload. However, our system has complex life-cycles (it is used in financial services administration) and it is necessary for us to check that the processing behind the Web Service has also taken place correctly and this can ONLY be achieved by querying the (SQL Server) database to ensure that the correct rows have been written to the correct tables.

Can anyone suggest to me how this may be done efficiently?

We would need, for example to (in a data driven way) call several web services as steps in a test and then query the database in order to ASSERT that the values in rows and numbers of rows found on the database following the calls to the web services correspond to expected results stored in the same data set that drives the tests.

Any ideas?

Jim

PS thanks if you can, becuase if this is possible we will be buying a few licenses straight away!!!!

2 Replies

  • sinnes_1's avatar
    sinnes_1
    Occasional Contributor
    Hey Jim,

    SQL queries in Groovy are quite easy! There's a fair bit of documentation on it floating around. A brief tutorial can be found here: http://docs.codehaus.org/display/GROOVY/Tutorial+6+-+Groovy+SQL

    I'm assuming you'd be checking the database for values based on what you use in your actual SOAP request, so to compare, you just need to pass your variables in to the groovy script, do your select statement and compare

    I tend to do data driven tests by using CSV files at present, but that's only because it suits what I'm testing. I do know you can get data from an MS Excel workbook by using the JXL library (http://jexcelapi.sourceforge.net/). So get your various data from various sheets in your workbook, then pass them to your various requests and other groovy scripts.

    Hope this is a good starting point. Feel free to ask specifics and I'll see if I can help

    Hopefully that's enough to get you started.
  • jdeane's avatar
    jdeane
    New Contributor
    Thanks!! Giving it a try :-)

    (First need to learn Groovy..)