Forum Discussion

JMcKinley's avatar
JMcKinley
Contributor
16 years ago

Global Groovy Class question

I want to use the following method in a global groovy class:

testRunner.testCase.getTestStepByName()

Is this possible? The system doesn't seem to like this method...

Do I need to import it?

Thanks!

2 Replies

  • alibaba82's avatar
    alibaba82
    Super Contributor
    Hi,
    I use it in my globalGroovy class by passing 'testRunner' as an argument to the method that uses it. So i have a method in my globalgroovy such as

    void foobar(testRunner)
    {
        def props = testRunner.testCase.getTestStepByName("BLAH")
    }

    then from soapui groovy step i call it
    globalgroovy foo = new globalgroovy()
    foo.foobar(testRunner)

    hope this works

    Ali