Forum Discussion

User999's avatar
2 years ago

Run Test Cases via Groovy Script


I am wanting to run specific test steps within Groovy Script that will then correlate to my DataSource excel.   In my datasource I have 3 fields that need to be called but they can't be run in the data source loop as it would run all 6 tests from the same test step.  It could run 1-2 which would be fine.  I didn't want to setup a new test case to point to DataSource start at A2, A4 etc.


I would basically want 6 test steps and the groovy script calling TC001, TC002, TC003 etc in every loop.


Let me know if anyone has any solution.


1 Reply

  • Hi User999 , 
    I don't have a groovy script example for you. I do have some non-scripted ideas that you could work with. 

    The first is to create multiple data sources and loops within the same test case. For each data source you can identify the target rows to run. Within the data source loop you can run the individual test steps to target. Then when that loop finishes you can then run another data source loop for the next test steps. 

    The second idea would be to use the Run Test Case test step. The Run Test Case test step runs a test case from your project as a test step. You can find information on this here.