Forum Discussion

rayne5446's avatar
rayne5446
New Contributor
16 years ago

groovy imports

Hey all,

Dumb question here.  Just getting started with groovy scripting.

In your SOAP requests, is there a way to group imports so you don't have to prefix all your statements with the package name?  Right now, I have to put "mypackage.utils" in front of everything.  I'd really like to do this import somewhere else.

{= mypackage.utils.SimpleCorrelatorFactory.getCorrelator() }

1 Reply

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    You could throw the package into context in the TestCase setup script:

    context.myclass = mypackage.utils.SimpleCorrelatorFactory


    Then reference it from the request:

    ${= context.myclass.getCorrelator()}


    But that doesn't save too many keystrokes.