Forum Discussion

larryx's avatar
larryx
Frequent Contributor
12 years ago

[R]SoapUI load test - ${ThreadIndex} in a property-expansion

Hello,
From http://www.soapui.org/Load-Testing/loadtest-scripting.html, it says below:
"LoadTest related properties in TestCase scripts
When a TestCase is run under a LoadTest, certain properties are made available in the TestCases context object which can be useful during scripting;
•context.ThreadIndex - contains the 0-based index of the current thread, so if you use ${ThreadIndex} in a property-expansion, that value will be unique to each thread running under the LoadTest."
I need to know how to get value of ${ThreadIndex} and/or where is property-expansion? Please Help Me!
Thanks,
Larry

3 Replies

  • This doesn't directly answer your question, but this workaround might help you:

    Try inserting a "DataGen" Test Step at the start of your TestCase. Create a variable called something like "index".
    Type = "Number"
    Mode = "Step"
    Shared = true
    Start = 0
    Step = 1

    This will create a variable that will increment by 1 for each thread, thus giving each thread a unique index of sorts.
    It can be accessed by: ${DataGen#index}
  • larryx's avatar
    larryx
    Frequent Contributor
    Hi EBaethke/Giscard,
    Thanks a lot for the alternative solution and valuable resource. My issue was solved.
    Thanks,
    Larry