Forum Discussion

atts's avatar
atts
Occasional Contributor
16 years ago

How can you retrieve the TestSuite and TestCase names using Groovy

Folks,

Within SoapUI, I have a several TestSuites, each with multiple TestCases, TestCases with multiple TestSteps.

Each TestStep contains a Groovy script which is trying to programmaticlly retrieve the Name of the
TestSuite, TestCase and TestStep for the current running test.

I've managed to work out how to get the name of the current TestStep using;

log.info context.testCase.getTestStepAt(context.getCurrentStepIndex()).getLabel()


but, can't seem to work out how to do this for TestSuite and TestCase, has anyone done this
before or Know if it's possible.

thanks in advance!
atts.
  • Hello,

    You can use this:


    //Current TestCase name
    log.info context.testCase.name

    //Current TestSuite name
    log.info context.testCase.testSuite.name


    Regards,
    Dain
    eviware support