Forum Discussion

ABCDEFG's avatar
ABCDEFG
Contributor
15 years ago

Groovy: To get Test Step Count

I am accessing Test Steps Count using Groovy,

Can some one help me to figure out issue with this code,

def newPropertyValue //integer declaration
newPropertyValue = testRunner.testSuite.TestCase1.getTestStepCount()

I am getting following error message -
{
groovy.lang.MissingPropertyException: No such property: testSuite for class: com.eviware.soapui.impl.wsdl.panels.support.MockTestRunner
}
I googled out this - No help!

Appreciate your help in advance!

^Thanks

3 Replies

  • deepesh_jain's avatar
    deepesh_jain
    Frequent Contributor
    try this:

    newPropertyValue = testRunner.testCase.getTestStepCount();
  • deepesh_jain's avatar
    deepesh_jain
    Frequent Contributor
    This is if you are trying to access the test steps of a test case from the same test case.

    If you have a groovy test step in Test Case A and you are trying to get test steps of test case B, then use it like this:

    newPropertyValue = testRunner.testCase.testSuite.project.testSuites["test_suite_name"].testCases["TestCaseB"].getTestStepCount();
  • This is Awesome!

    Thank you very much Deepesh! - Deeply Appreciated!

    As you guided in my prev-post, I have started learning groovy... did many samples... and facing n-number of challenges, however i am moving with my groovying. Keep help me!

    Can you please address my other query! [Groovy: Code to Access TestStep Property ]

    ^Best regards