Recall & Review
beginner
What is dynamic data in API testing?
Dynamic data is information generated during test execution that changes each time, like random user names or timestamps, to simulate real-world scenarios.
Click to reveal answer
beginner
How can you generate a random email in Postman?
Use the built-in JavaScript function in the Pre-request Script tab, for example: `pm.variables.set('randomEmail', `user${Math.floor(Math.random()*10000)}@mail.com`);`
Click to reveal answer
beginner
Why use dynamic data instead of static data in tests?
Dynamic data helps avoid false positives by testing with varied inputs, making tests more realistic and catching issues that static data might miss.
Click to reveal answer
intermediate
What Postman feature helps to generate dynamic data easily?
Postman has a built-in library called Faker that can generate names, emails, addresses, and more using syntax like `{{$randomFirstName}}`.
Click to reveal answer
beginner
Show an example of setting a dynamic timestamp in Postman.
In Pre-request Script: `pm.variables.set('currentTimestamp', new Date().toISOString());` This sets a variable with the current date and time in ISO format.
Click to reveal answer
Which Postman feature allows you to generate random user names easily?
✗ Incorrect
The Faker library in Postman provides many random data generators like user names.
Why is dynamic data important in API testing?
✗ Incorrect
Dynamic data tests with different inputs each time, helping find bugs missed by static data.
How do you set a dynamic variable in Postman Pre-request Script?
✗ Incorrect
Use pm.variables.set() to create or update a variable dynamically before the request.
Which of these is NOT a way to generate dynamic data in Postman?
✗ Incorrect
Hardcoding values is static data, not dynamic data generation.
What does this Postman script do? `pm.variables.set('id', Math.floor(Math.random() * 1000));`
✗ Incorrect
It generates a random number from 0 to 999 and stores it in variable 'id'.
Explain how to generate and use dynamic data in Postman for API testing.
Think about how you prepare data before sending a request.
You got /4 concepts.
Why is generating dynamic data beneficial for test reliability and coverage?
Consider how changing inputs affect test outcomes.
You got /4 concepts.