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)

API Trace View

Struggling with slow API calls?

Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →