I need to generate a dynamic email address, username for API automation testing in postman. can you help me with this please.
I see two options on how you can get what you need.
Using already defined dynamic variables, such as timestamp: For example where you need a new email address, just use this:
user_{{$timestamp}}@example.com
The request will be sent with something like: user_1497475549@example.com
Define an variable in the pre-request script:
var randomEmail = 'DO YOUR PREFERRED RANDOMIZATION HERE'; pm.setEnvironmentVariable("email", randomEmail);
and use that variable like {{email}} when sending the request.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.