randomNumber after running this script?const randomNumber = Math.floor(Math.random() * 10) + 1; pm.environment.set('randomNumber', randomNumber);
Postman environment variables always store values as strings, even if you set a number. So randomNumber will be a string like "7".
timestamp that contains the current time in ISO format. Which Postman test assertion correctly checks that timestamp is a valid ISO date string?const jsonData = pm.response.json();
Option C parses the timestamp string into a Date object and checks that it is not 'Invalid Date', which means the timestamp is a valid ISO date string.
Option C is invalid because Postman assertions do not recognize 'date' as a type.
Option C incorrectly expects the parse to be NaN, which means invalid date.
Option C wrongly expects the timestamp to exactly match the current time, which is unlikely.
const timestamp = pm.environment.get('timestamp'); if (!timestamp) { pm.environment.set('timestamp', Date.now()); } const email = `user_${timestamp}@example.com`; pm.environment.set('email', email);
The script sets the timestamp environment variable only if it does not exist. After the first run, the timestamp stays fixed, so the email does not change.
To fix, update the timestamp every time or use a local variable.
Option D allows dynamic data generation in pre-request scripts for each iteration in the Collection Runner, enabling unique data per run.
Option D uses static data, so no dynamic generation.
Option D is manual and not scalable.
Option D schedules runs but does not handle dynamic data per iteration.
Dynamic data generation helps create unique inputs each time, preventing conflicts like duplicate user creation and better simulating real usage.
It does not reduce assertions or guarantee passing tests, nor does it remove the need for environment variables.