Creating Load Test using Wsdl classes in java project. Having each thread to be different
Hi,
I am creating a Load Test using the com.eviware.soapui.impl.wsdl.loadtest.WsdlLoadTest class in my Java project. When I run the loadTest it works, and the endpoint does what it is supposed to do to a member. The thing is I need each thread to be a different member.
Here I go into my TestSuite, and then into my testCase. I set the propertyValue of the testCase.
WsdlTestSuite testSuite = testProject.getTestSuiteByName("Reward");
WsdlTestCase testCase = testSuite.getTestCaseByName("TriggerActivityReward");
testCase.setPropertyValue("memberId", "182996");
The testStep gets the data of the memberId from the testCase property "memberId". As such:
"${#TestCase#memberId}"
In the JSON of the POST rest endpoint.
Then I setUp my loadTest.
loadTest = testCase.addNewLoadTest("firstLoadTest");
loadTest.setThreadCount(5);
loadTest.setLimitType(Enum.forInt(1));
loadTest.setTestLimit(1);
I need each thread to have a different memberId every run. How could I achieve this? I have gone through the documentation of the com.eviware.soapui.impl.wsdl.loadtest.WsdlLoadTest class, and I haven't found much. I also so something like context.ThreadIndex by adding a setUp groovy script to the loadTest. I tried that but didn't work.
Any thoughts? Ideas?
Thanks!
Then you can define the list with valid values in a groovy script before json request step
def list = [12343, 12345, 342432,3432,32131]def index = new Random().nextInt(list.size())
context.testCase.setPropertyValue('memberId', "${list[index].toString()}")