Forum Discussion

tstmartin's avatar
tstmartin
Contributor
14 years ago
Solved

How to find the parent Test Case of a Run TestCase step?

I have a Groovy script (MyGroovyScript) in a common test case. That test case is being used in other test cases using a Run TestCase test step. I need to determine from within MyGroovyScript what...
  • SmartBear_Suppo's avatar
    14 years ago
    Hi!

    The context available in your groovy script should contain a property named "#CallingRunTestCaseStep#" holding the calling Run TestCase TestStep, so you should be able to do:

    def calling = context.getProperty( "#CallingRunTestCaseStep#" )
    if( calling != null )
    {
    log.info( "Being called by " + call.testCase )
    ...
    }


    Does that work ok for you?

    regards!

    /Ole
    eviware.com