Forum Discussion

Finan's avatar
Finan
Frequent Contributor
15 years ago

[Resolved] Groovy (load) scripts

Hi,

I have a few questions for groovy scripts

1. How do I check (in groovy) if a testCase/TestSuite/Project is run from commandline?
2. How do I check (in groovy) if a testCase is run as a loadTest?

4 Replies

  • Hi!

    you'll need to upgrade to the nightly build, then you can use

    SoapUI.isCommandLine()

    to determine if you are running from the command line.

    To determine if a TestCase is running under a LoadTest, you can check for the LoadTestRunContext in the context;

    if( context.LoadTestContext != null )
    {
    // running under a load test...
    }

    Hope this helps!

    regards,

    /Ole
    eviware.com
  • Finan's avatar
    Finan
    Frequent Contributor
    Thanks for the reply, the loadTest check works perfectly.

    I downloaded the nightly build
    The SoapUI.isCommandLine() returns "no such property (SoapUI) for script...."
    What do I need to do to get this working?
  • Hi!

    sorry, that should have been

    com.eviware.soapui.SoapUI.isCommandLine()

    any better?

    regards,

    /Ole
    eviware.com