Ask a Question

Event handling to run another API after each data row has completed running

Occasional Contributor

Event handling to run another API after each data row has completed running

Hi All,


We have a requirement to map our test cases to qtest. Currently we have test cases in excel. For each api, lets say we have 10 test cases inside a workbook. These 10 rows of data in that workbook represents each test case. We have a data driven test suite in place already. 


So, once a row has finished running, we want to go and update the corresponding test case in qtest as pass/fail. We thought of doing this using event handlers. Like, once a row has finished running in readyapi, the event handler will trigger the qtest api and make it pass/fail. But we could not find any events which is present for each data row execution. We could see test run listener, test step, test case


Kindly suggest a way for the above approach, or if there is any other alternative way to complete this, kindly suggest that as well


Thanks in advance:)

Community Hero

May be you want do it (calling qtest api programmatically) from tear down script instead of events.
Because, the events are triggered even before the assertions are run; so will not have the status of the test.

Occasional Contributor

Yes . But keeping it at the teardown , the scripts there will run once all my data row has finished running. But we want to update qtest for each data row. So we have kept the script to update qtest as a test step itself


Anyway, thanks for the reply rao



I'm not quite sure how you would actually update QTest, but in your data driven test, you could add a Groovy script within the loop that could update QTest on each iteration of the loop.


With Groovy script you can pretty much do whatever you want. 

If you want to update for each row, hold the data (which you need to update in qtest) and create the list and update the same (list) from teardown. If qtest can support updating bulk data, then you can send all the data (which was build above in the list) in single call. Otherwise, you have to iterate thru the list and make multiple calls.

Like @ChrisAdams suggested, you can do that as well after itearation of your data driven test.

SmartBear Alumni (Retired)

Thanks, Community!


@Sritharan do the suggestions help?

Sonya Mihaljova
Community and Education Specialist

Showing results for 
Search instead for 
Did you mean: