Forum Discussion

itaykaldi's avatar
itaykaldi
Contributor
11 years ago

Get number of threads and total runs with Groovy

Hey,
How can I get from groovy script the number of threads I selected and the limit of Total Runs in Simple Strategy?
  • Hi,

    You can first enable the logs for load test by, Go to Preferences, UI Settings & check the "Do not disable the groovy log when running load tests" check box.
    You can the click on the LoadTest > Setup Script
    Add this groovy script

    log.info loadTestRunner.getRunningThreadCount().toString()


    You can check the LoadTestRunner SoapUI Pro API for more methods,
    http://www.soapui.org/apidocs/com/eviwa ... unner.html

    I did not understand what limit of total runs in Simple strategy implies but I would suggest you to go through the above API.

    Thanks,
    Jeshtha
  • I mean the total runs,
    I didn't find how to get this property with SoapUI pro API

    See Attachment.

    10x.
  • Hi,

    This code will fetch all the properties for load test,

    def properties = loadTestRunner.getLoadTest().getProperties()

    //your request
    log.info "Test limit "+ loadTestRunner.getLoadTest().getTestLimit()

    for (prop in properties) {
    log.info prop
    }



    Thanks,
    Jeshtha