rajs2020
4 years agoFrequent Contributor
ReadyAPI - Return entire result set from a database ?
I have a run test case step in Test1 which calls a Test2. Test2 only has one JDBC step at the moment. I want to return the entire result set from Test2 to Test1, preferably in the form of a single "object". How do I do that? How do I access the rows and columns in that "object" via a groovy script? Something like this:
Test 2 - JDBC step :
return TableLikeObject or Json.
Test1 - Groovy test step :
TableLikeObject table = Test 2 - JDBC returned value.
table.getRow(1).getColumn('Employee name')
Test1 calls Test2.
rajs2020 : you can do it by following way:
//if in same Test Case def teststep = testRunner.getTestCaseByName("TestCase2").getTestStepByName('JDBC Step') //if in different Test Case def teststep = testRunner.testCase.testSuite.getTestCaseByName("TestCase2").getTestStepByName('JDBC Step')