DEV Community

Cover image for [Postman] Set random numbers in your test name
Daphné Hervé
Daphné Hervé

Posted on

[Postman] Set random numbers in your test name

Love sharing my best postman recipes, today a precious advice
Enter fullscreen mode Exit fullscreen mode

To set dynamically a variable in your test name.

pm.test(["TEST - " + pm.variables.replaceIn('{{$randomInt}}')], function () {
    pm.response.to.have.status(200);
});
Enter fullscreen mode Exit fullscreen mode

You will get random value in the the name on the TSF report.

Appreciate the result :

Test result in the TSF report

There is a lot of very useful value with the Faker library :
$timestamp or $randomAlphaNumeric

Take a look here for more details about all the ramdom value that you can use : Official documentation about this topic

Hope it's help !
Daphné Hervé (API, monitoring and QA automation lover)

Top comments (0)