Skip to main content
Dynamic variables enable you to generate and use random data in your testing workflow. Bruno uses the faker.js library to generate random data. You can use these variables like any other variables in Bruno. The syntax to use dynamic variables is {{$randomData}}, and you can use them in the request body, authentication, parameters, and other fields.
Dynamic variables are case-sensitive and follow the camelCase convention. This feature is available in Bruno version 2.x and above.

Using Dynamic Variables in Scripts

To use dynamic variables in pre-request or post-response scripts, use the bru.interpolate() function. For example:
The bru.interpolate() function allows you to embed dynamic variables in strings and have them evaluated at runtime within scripts, just like they would be in request bodies or headers.

Usage Examples

Here are some common use cases for dynamic variables:
  1. Test Data Generation:
  2. Authentication:
  3. Business Data:

Available Dynamic Variables

Bruno provides a comprehensive set of dynamic variables for generating test data. These variables are organized into categories based on their functionality.

Basic Data Types

Internet and Network

Names and Personal Information

Location

Images

Finance

Business

Database

Dates

Files and System

Commerce

Hacker and Lorem