Here Period and Salary for the period is dynamic and different customers can have different number of periods.i.e (Period1 and SalaryPeriod is part of a list which can have any number of entries depending on customer)
So the number of entries for Period and SalaryPeriod how can I define dynamically ? As of now
if I wanted to test for different customer each time I need to update the CSV file with that particular customers period details…How can I dynamically update this period details in the CSV file ?
i.e. I am trying to add a dynamic list (which can have 1 to N occurances) into postman request
As of now i need to update CSV file for different customers as number of occurance for each customer is different
I am using collection runner and we have one csv to pass data but the the problem is one of the object is a list ( eg.membership period which have different fields like period from date,periodtodate,salary etc) and different customers can have different number of periods like some customer can have 5 periods, another customer can have 70 periods etc.
Currently, if customer have 10 periods then we need to repeat fields in the array 10 times in the CSV file (like period1fromdate,period1todate,salary1, period2fromdate,period2todate,salary2 etc till 10) .This also makes main CSV file very huge since some customers can have 75 to 100 periods.
We were trying to see whether is there any better way to dynamically pass this data to postman test?
It is not possible to use {{$randomInt}} because during testing we need to provide the actual data for that customer to verify the results and the calculation happens based on this data…
One option which I am thinking is to keep this period data as a separate CSV then expose it via rest endpoint and fetch it in pre request script and then prepare the input.
In this case main CSV file will have only information about which CSV to use to prepare member ship data and other basic fields.
In pre request script we will fetch that CSV with membership period data using rest GET call and then prepare the final data required for testing…
Pls suggest if you see any other better options here…
Row first name LastName emp no fromDate(0) toDate(0) salary(0) salaryAdditional(0) fromDate(1) toDate(1) salary(1) salaryAdditional(1) fromDate(2) toDate(2) salary(2) salaryAdditional(2)
If you see above those are the fields which are available in the CSV file which I am using in collection runner while running tests and if you see the fields from date, todate, salary and salaryadditional (actually request have more fields in this array) those are part of an array.
In the above request, we have 3 occurrences but the problem is another customer can have 10 or 100 occurrences. I wanted to pass this array as a separate object to my postman test.
Currently, what I am planning to do is to keep this as separate CSV file, then fetch it via rest request and form the request in the pre-request script.
Is there any other better way to dynamically provide this input to my postman test?
Is it possible to access get data from multiple data files for my postman test ? My csv file is very huge so wanted to keep some of the objects in separate data files then I read these data files in pre request script to form the final request…Is this possible ?