0
votes

I am new to Postman and this is my first question on Stack Overflow. I would like to know if how I can generate the random SSN number for the US, it's 9 digits integer number.

I want to populate the Environment Variable SSN from the Pre-request step, and use that SSN in the request body.

1

1 Answers

1
votes

Welcome to the Stackoverflow. You could easily find this out if you search google for " Javascript generate 9 digits random number"

Javascript is used in Pre-request Script of Postman

// GENERATE RANDOM SSN  Number
ssn_random = Math.floor(Math.random()*8+1)+Math.random().toString().slice(2,10);
pm.environment.set("ssn", pm.variables.replaceIn(ssn_random));