2

I need to generate a dynamic email address, username for API automation testing in postman. can you help me with this please.

Uppi B
  • 21
  • 1
  • 4

1 Answers1

0

I see two options on how you can get what you need.

  1. 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

  2. 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.

Valentin Despa
  • 40,712
  • 18
  • 80
  • 106