-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random variable in json body #620
Comments
Hi, same question for header and postman {{$randomUUID}} |
@standej it should work if you use |
Hi @KaniZ0r I tried to do with collection variables and it still dont work: Bruno version 0.25.0 Unfortunately still not working and do not interpolate value |
It would be nice to provide a feature that allows to generate random values in the json payload directly to simplify the usage. |
I exported my tests from postman and imported them in Bruno. In lots of tests I used postman built in feature for random username {{$randomUserName}} or random number {{$randomInt}} and I was putting this dynamic values in json body of the call.
https://learning.postman.com/docs/writing-scripts/script-references/variables-list/
Postman example if i set companyNumber env variable in pre request:
{ "companyNumber": "{{companyNumber}}" }
The problem is that Bruno didnt imported it properly and i can't find a way to put in json body dynamic random environmental variable (string or int).
I tried something like this in script pre request so I get random number:
bru.setEnvVar("companyNumber", Math.round(Math.random() * 100000000));
I checked and Bruno randomize proper value and set env variable properly but i cant put this value inside request json body from env variable.
And in body I tried something like this:
{ "companyNumber": "{{companyNumber}}" }
but without success.
So my question is how I can put dynamic random variable in json body of the request in Bruno?
The text was updated successfully, but these errors were encountered: