Forum Discussion

Syavosh's avatar
Syavosh
New Contributor
7 years ago

multiple datasinks in one test step.

I am executing 4 separate JDBC steps in a test case and want to write each result as a new row into EXCEL using DataSink.

is this possible in ReadyAPI?

2 Replies

  • avidCoder's avatar
    avidCoder
    Super Contributor

    Yes, We can do it. Put all the results and iterate using for loop and store inside DataSink like this:-

     

    int j

    def result = "get it from JDBC and iterate through all the results and store inside result"

     

    for(int i=0; i<result.size(); i++) {

    testRunner.testCase.testSteps["DataSink"].setPropertyValue(result[j], Value) //where "j" will give you the number of result

    }

    • Syavosh's avatar
      Syavosh
      New Contributor

      Thanks, Will give it a go.

      Regards

      Syavosh