Forum Discussion
{
"memberID" : "${= System.currentTimeMillis()}"
}
Sorry, I rephrase my reply. What if I have specific value for the memberIDs, they can't just be random values. I have them stored in my db.
- nmrao8 years agoChampion Level 3Provide more details.
- pratoa8 years agoOccasional Contributor
I am using the com.eviware.soapui.impl.wsdl.loadtest.WsdlLoadTest import in my java project. I get my TestCase in the java project and I add a LoadTest. I run it and it works. The only thing is that all threads are using the same member. In my POST the JSON looks like this: {"memberId":"${#TestCase#memberId}","sponsorId":"${#TestCase#sponsorId}","activityType":"${#TestCase#activityType}","activityDate":"${#TestCase#activityDate}","activityDetails":null,"pointProcessor":false,"fromBatch":false}
So, the memberId, and other variables I am getting them from the properties of the TestCase using "#TestCase#memberId". What I am trying to do is change the properties of the TestCase before each thread or user is created in the LoadTest, so the memberId changes with every thread, that way being "unique" each time.
I am trying to create a script with groovy and add it to the LoadTest or a way to change the properties of TestCase through java code.
In my reasearch I found this Groovy script that gets every thread. But for me it doesn't work. It doesn't print all the threads, it only prints a few.
def threadIndex = context.ThreadIndex;
log.info("Hi, I'm thread "+threadIndex);Thank you and hope this is enough information. Thanks for the help!