Forum Discussion
Hi,
first of all, with a groovy script (e.g. step-1) you can set a property value with the size of the result (grantscnt) and save an additional property for take note of actual result index, example:
def grantscnt = parsedJson[0].Grant.Project.Grants.size;
testStep.testCase.setPropertyValue("grantscnt", grantscnt);
testStep.testCase.setPropertyValue("grantindex", "0");
then in the next groovy step (e.g. step-2) get the values of the first grantDetailId and save as properties and update actual result index:
def index = testStep.testCase.getPropertyValue("grantindex").toInteger();
testStep.testCase.setPropertyValue("grantindex", (index +1).toString() );
now you can get the properties values and use as you want (SQL, requests, etc)
and finally with a groovy script step go to step-2 and get the next index until grantindex<grantscnt using the gotoStepByName function
- krispokkuluri3 years agoOccasional Contributor
Hi Ilario72 ,
Firstly thanks for your response, So as you can see there are 2 for loops . so do you think i can utilize this approach to get data from the both loops or maybe if possible you can suggest a decision statement to get the values i basically need startdate, endate and qty for a query and another groovy attaching my project for your reference . Can you tell me accordingly . I am really new to groovy and ReadyAPI
Related Content
- 4 years ago
- 8 years ago
- 10 years ago
- 3 years ago
Recent Discussions
- 15 years ago