Generate random user data in Postman pre-request script
Preconditions (3)
Step 1: Open the Postman app and select the request to automate
Step 2: Go to the Pre-request Script tab
Step 3: Write a script to generate a random first name, last name, and email
Step 4: Set these random values as environment variables
Step 5: Send the request using these variables in the request body or headers
Step 6: Verify the request payload contains the generated random data
✅ Expected Result: The request is sent with unique random user data each time, visible in the request body or headers, and environment variables hold the generated values.