Forum Discussion

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

loadTest strategy script

I'm running a loadtest, for which the strategy is set as script and threads has initial value 5.
The script looks as follows :
return context.getProperty("threads")

I'm reading the desired nbr of threads (currently 1) from a config file and setting it as property during loadtest setup script.

When starting the loadtest, I'm using initially 5 threads, after which the scripts seems to update the nbr of threads to 1.
How come that the number of threads is set correctly afterwards ? I would expect that from the first execution, the number of threads should equal 1 iso 5.

Additionally, is there a possibility to configure the value and type for limit and the initial number of threads, during the setup script. In some cases, I would like to run the testcase e.g. 100 times, in other cases it should run for e.g. 9000 seconds. I would like to make these configurable via the config file, which is read during loadtest setup script.

3 Replies

  • Hi!

    1) The script strategy runs the script at the configured interval once the loadtest has started running, so in your case the script will run after the test has started with 5 threads

    2) Sure! You can call

    import com.eviware.soapui.config.LoadTestLimitTypesConfig

    loadTestRunner.loadTest.testLimit = 100
    loadTestRunner.loadTest.limitType = LoadTestLimitTypesConfig.COUNT

    or

    loadTestRunner.loadTest.testLimit = 9000
    loadTestRunner.loadTest.limitType = LoadTestLimitTypesConfig.TIME

    regards,

    /Ole
    eviware.com
  • Alcatel-Lucent__10's avatar
    Alcatel-Lucent__10
    Occasional Contributor
    1) The script strategy runs the script at the configured interval once the loadtest has started running, so in your case the script will run after the test has started with 5 threads


    Related to point 1, I have done some additional tests and found the following :

    When initial nbr of threads is set to 5 in the gui and put to 1 via groovy script, my first run will have 5 threads, later runs will use 1 thread only.

    When the initial nbr of threads is set to 1 in the gui and put to 3 via groovy script, my first run will have 3 threads.

    In both cases, the strategy interval is set to 0.

    So in the first case, the behaviour is different from the 2nd case. 2nd case is not inline with the explanation above.
    How come the behaviour is different in both cases ?