Forum Discussion
Ritchie,
This is my first experience using Groovy scripts and setting up a load test with multiple test steps, I've been using a Udemy course on Webservices/Rest API Testing so I have what I can only assume is a good reference. That said, the course does not cover all, here is my use case:
1. Eight test step requests from Oracle OIBEE projects have been gathered to form a Load Performance Test Suite
2. Each test step's payload.xml file needs to have the ReferenceID value incremented each time a request is sent otherwise the system will error and it will not be processed (nor assigned a TransactionID).
3. I have Groovy script incrementing the ReferenceID in the groovy console, solution was found on Stackoverflow as noted.
4. Now I need to sync the script with the payload.xml so each time I send a request from the test step itself, the RefID auto-increments. Currently, if I increment the Script and then execute a Request, the ReferenceID is incremented, but if I do NOT increment the Script and then execute a Request, the new Request shows the same ReferenceID as the previous one, though the TransactionID does increment, but that request is errored.
5. Finally, after my script is functioning, I'll use it in all 8 of the test steps so when I throw off a Load Test with the 8 test steps all of the requests will at least process to the extent that each request will be assigned a new Reference & TransactionID, whether they error in a system if they overload is another issue, but not my concern.
Thanks for your interest.
Stephan
Just to be clear, i wasnt criticising your groovy, it just looked like a lot of it was superfluous to requirements which made me think i was misunderstanding something.
More questions:
Q1. What is the datatype and minlength and maxlength of the ReferenceId
Q2. Does the ReferenceId have to be incremented or does it just need to be unique?
Q3. Going on memory here cos im on my phone. In the original script you had an if clause something like 'if ReferenceId > 999000'. Can you just explain what this value was and what the purpose of the if clause was supposed to do?
Ta
Rich
When you say the