Forum Discussion

Kathryn_O_Malle's avatar
Kathryn_O_Malle
Contributor
15 years ago

API command to list all testCase names in a testsuite?

Hi,

Is there an API command that will list all testCase names for the current testSuite? And also all testSuite names for the current project?

NB:With the forum's help I've been able to list all property names for testCase or testSuite using API calls like:
for (name in testRunner.testCase.testSuite.propertyNames)
{
log.info("$name = ")
}


Many thanks...
Adam Hall
  • Sure!


    //TestSuites in a Project:
    for( testSuite in project.testSuiteList ) {
    log.info testSuite.name
    }

    //TestCases in a TestSuite:
    for( testCase in testSuite.testCaseList ) {
    log.info testCase.name
    }

    //TestSteps in a TestCase:
    for( testStep in testCase.testStepList ) {
    log.info testStep.name
    }


    Regards,
    Dain
    eviware.com