Forum Discussion

divman's avatar
divman
Contributor
11 years ago

Script to get total test step count of enabled steps?

Hi,

I know to get the total test step count from a test case. But is there any script to get the total count of only enabled test steps in a test case?
  • Hello,

    FYI, we do not support custom code solutions.

    You can call the isDisabled() method for a TestStep. So use your existing script which counts teststeps in test cases and call the isDisabled() method for the test step.

    Example:
    def count = 0;
    if ( !testStep.isDisabled() ) {count++;}

    http://www.soapui.org/apidocs/com/eviwa ... tStep.html

    Regards,
    Marcus
    SmartBear Support
  • Yes. I have written a custom code for that. But like testCase.getTestStepCount(), i just wonder, is there any keyword to get only enabled test steps. But anyway thanks.

    Here is the custom code i had.

    totalSteps = testRunner.testCase.getTestStepCount()

    for(i=0; i<totalSteps; i++)
    {
    flag = testRunner.testCase.getTestStepAt(i).disabled
    if(flag == "false")
    {
    counter = counter + 1
    }
    }
  • Hi,

    No, there is no direct method call that will provide a count for that. The script you posted should be sufficient to accomplish that. Thanks for posting.



    Regards,
    Marcus
    SmartBear Support