I want to generate unique numbers within a range to create Ids to be used in my XML file, Unfortunately ```
#{randomLong(2147483648,2147483658)}"
this Gatling EL function generating the random numbers for me , Can someone have any solution handy for this c, To generate unique ids . to be used in ELFileBody.
You don’t explain what your problem is and a part of your sentence is missing.
Please properly explain how the out-of-the-box feature doesn’t work for you so people can help you.
I am understanding that “unique” mean you don’t want the number to be reuse in any case later on.
If that’s the case, then you have to define a way to save the number generated from using #{randomLong(2147483648,2147483658)} Maybe save to a CSV file ?
Then you need to write a method to check the CSV if it’s containing the ID.
Pseudo-code to simplify
when
#{randomLong(2147483648,2147483658)} //generate number
saveOutputInto(csvFile) //Method to save
then
checkDuplicateID(csvFile) //Method to check the ID saved in the csv
when
//execute your logic below, maybe if else or something above
I am already passing a CSV feeder to my scenario , to the same scenario i need to generate the order id , In that case i believe we cant pass two feeders to a scenario , Please correct me if i am wrong ,