Iterate rows in JDBC Data Source
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Iterate rows in JDBC Data Source
Does anyone know how to iterate over the result set returned by the JDBC Data Source? I can only seem to get the last row in the set.
This is what I have come up with so far
def var = testRunner.testCase.testSteps['DataSource'] def rowCount = var.rowCount as int log.info "ROW COUNT = " + " " + rowCount for ( item in rowCount ){ log.info var.getProperty('systemId').value }
This will only return the very last row in the query results.
In my project I have 3 Data Sources. The second Data Source is the one I want to iterate through. I want to collect some values, pass them into a Properties step and then validate a subsequent Soap response against these values.
I can't think of a way to do this using Data Source Loops, which I am using for the other two Data Sources but the middle Data Source is not being used for gather inputs, I just want to validate a response later on based on the query results.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here some script done earlier based on the data provided by user. May be this gives an idea to get started with.
https://github.com/nmrao/soapUIGroovyScripts/blob/master/groovy/compare/xmlAndJdbc_sample1.groovy
https://github.com/nmrao/groovyScripts/search?utf8=%E2%9C%93&q=ResultSet&type=
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you @nmrao for your response. I am not using a JDBC Request step I am using the JDBC Data Source so the response is not in XML format.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No problem, thanks for trying to help.
