I've been using SoapUI to test WS the next way (common structure of TestCase):
- Groovy script to generate data (for request compilation & response checking)
- SOAP Request with assertions
Groovy script code example (pseudo code, just to show idea):
// variables declaration
com.eviware.soapui.support.GroovyUtils.registerJdbcDriver("oracle.jdbc.driver.OracleDriver")
sql = Sql.newInstance("jdbc:oracle:thin:@${scriptDenServer25}:${scriptDBport}:${scriptSid}", "${scriptUsername}", "${scriptPassword}", "oracle.jdbc.OracleDriver")
// request to DB (get one random row)
// assign data to variables
sql.close()
This works pretty well in cycle "one request after one", but when I use this TestCase in Load Test scenario there is a problem of quantitiy of connections to DB. There are as many connections as number of threads.
Is there any way to avoid this "spoiling of connections"?
UPDATE: the database open/get data/close is NOT the part of that performance measurement. It is just test/check data preparation. So idealy there should not be any time wasting for DB connection, just requests. But I need unique data & real data, so there is no possibility to avoid working with DB, so this part should be as less time/resources consuming as possible.
There are two (as I see now) possible scenario to solve the problem (Don't know whether it is possible in SoapUI):
- To get N rows at one DB connection and then go through them untill they are over, then repeat this once again. (We reduce DB connection N times, maybe...) (There should be possibility in SoapUI to call SOAP request from Groovy script - in a loop for each row)
- To organize one stack (FILO) of test/check data for all threads, would be the best solution (only one connection), but still do not know whether it is possible in SoapIU.