At the moment there is no option to set variable globally. Options that are available are the following: 1. Create an environment and add variable under that. 2. Making use of vars tab 3. by using getVar() and setVar() API at collection level. 4. DotEnv File
Dynamic variable is not available in Bruno. But you can use any external module. Please check the 15 th video in playlist. There I have used faker library to create data. Steps are as follows: You need to add a package.json file where your collection is stored. { "name": "github-rest-api-collection", "version": "1.0.0", "main": "index.js", "homepage": "github.com/usebruno/github-rest-api-collection#readme", "dependencies": { "@faker-js/faker": "8.3.1" } } And then run following command inside your collection folder using terminal/cmd: npm install Then in script tab of your request use the following script and use the uuid value as you need: const { faker } = require('@faker-js/faker'); const uuidValue = faker.string.uuid() req.setBody({ name: uuidValue, job: uuidValue });
No the video is in Malayalam language. But still you can follow the video. If you have any doubts in this video, please ask. I am happy to answer. I will add the github link of the project here and in video description as well. github.com/thetestinginstinct/BrunoAPITesting
Is it possible to do set a variable globally? Instead of setting it for a speicfic collection?
At the moment there is no option to set variable globally. Options that are available are the following:
1. Create an environment and add variable under that.
2. Making use of vars tab
3. by using getVar() and setVar() API at collection level.
4. DotEnv File
Hi, How can I use the variable below {{$guid}} in bruno? it is not recognized....
Dynamic variable is not available in Bruno. But you can use any external module. Please check the 15 th video in playlist. There I have used faker library to create data. Steps are as follows:
You need to add a package.json file where your collection is stored.
{
"name": "github-rest-api-collection",
"version": "1.0.0",
"main": "index.js",
"homepage": "github.com/usebruno/github-rest-api-collection#readme",
"dependencies": {
"@faker-js/faker": "8.3.1"
}
}
And then run following command inside your collection folder using terminal/cmd:
npm install
Then in script tab of your request use the following script and use the uuid value as you need:
const { faker } = require('@faker-js/faker');
const uuidValue = faker.string.uuid()
req.setBody({
name: uuidValue,
job: uuidValue
});
Is this English?
No the video is in Malayalam language. But still you can follow the video. If you have any doubts in this video, please ask. I am happy to answer. I will add the github link of the project here and in video description as well. github.com/thetestinginstinct/BrunoAPITesting