03-20-2017 02:34 PM
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");
The testStep gets the data of the memberId from the testCase property "memberId". As such:
In the JSON of the POST rest endpoint.
Then I setUp my loadTest.
loadTest = testCase.addNewLoadTest("firstLoadTest");
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?
Solved! Go to Solution.
03-21-2017 03:39 AM - edited 03-21-2017 03:40 AM
Change from :
03-21-2017 05:33 AM
Thanks for your response Rao. The thing is I have an array lets say with 100 memberIDs, those are the memberIDs I need to use, they can't just be random numbers. Inside my JSON I also have a groupID which is the group that memberID is part of. I also have another array with the groupIDs I need to use.
Is there anyway to get every thread, and change the properties of the TestCase just before a thread ("user") is created for the Load Test?
03-21-2017 05:43 AM - edited 03-21-2017 07:27 AM
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())
03-21-2017 06:00 AM
Hi Rao, Thank you so much for your help! Is this script a setUp script for the LoadTest or a script for the TestStep?
Thank you again!