Forum Discussion

Rhonda_Ward's avatar
Rhonda_Ward
Occasional Contributor
14 years ago

Get number of test cases before the execution of the project

Is there is way to get total no. of test cases in the project before the execution?
  • Hi,

    Yes, you could write a groovy script to count the testcases:


    def testCaseCount = project.testSuites.collect( { it.value.testCases.size() } ).sum()


    Getting the current Project may differ depending on where you run the script from. What do you intend to do with the value? If you run this as a Setup Script for the project, the project variable should be available right away.

    Regards,
    Dain
    SmartBear Sweden