Forum Discussion

Alcatel-Lucent__10's avatar
Alcatel-Lucent__10
Occasional Contributor
14 years ago

[Resolved] How to stop loadtest from groovy script

Hi,

I have a testcase, which contains a small groovy script that is performing some checks.
In case the checks fail, I want to stop the testcase.

Now I want to run this testcase as a load test, using several threads.
In the groovy script, I use following statement to stop :
testRunner.fail("Failed testcase")

This command is stopping the thread where it happens, but not the other running threads of the loadtest.

Is there a way to have all threads of a load test stopped from a groovy script ?

Thanks for the help.
Philip

4 Replies

  • Finan's avatar
    Finan
    Frequent Contributor
    Can you show the script you use to run the loadTest as multithreaded?
  • Alcatel-Lucent__10's avatar
    Alcatel-Lucent__10
    Occasional Contributor
    Hi,

    Not sure what you exactly mean with :

    Finan wrote:
    Can you show the script you use to run the loadTest as multithreaded?


    Do you mean the script that sets the number of threads ?
    Do you mean the setup script of the loadtest ?
    Or the script that makes the analysis ?
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    try the following script:

    if( context.LoadTestRunner!= null )
    context.LoadTestRunner.cancel( "Cancelling LoadTest" )

    Does that work?

    regards,

    /Ole
    eviware.com