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

How I Cut 22.3 Seconds Off an API Call with Sentry

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)

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series