You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible that my interpretation is incorrect but in which case I would like to understand how the following feature works.
If we go to the Vars section we can define the variables and their values.
In js scripts, we should be able to access these variables/values using getVar
So far so good. However, when unchecking the vars section of the checkbox, my expectation is that the script cannot obtain the value of the variable because in theory the checkbox is unchecked, but even so getVar can continue obtaining the value even if it is not checked. This only happens once you check it and uncheck it, the value remains set forever until you restart Bruno and try again first unchecking the getVar checkbox will say null.
From my point of view, unchecking the checkbox means that the value is cleared(null or even not set). Is it a bug? feature? Or misinterpretation on my part?
The text was updated successfully, but these errors were encountered:
jjmonsalveg
changed the title
How does Bruno set variables?
How does Bruno (un)set variables? (checkbox+getVar)
Oct 20, 2023
Note: As of today, collection variables can only be set via the API - getVar() and setVar().
In the next release, we will add a UI to set and modify collection variables.
This probably can explain the "expected" behavior which has persistence between calls, and we can check the values in the Variables section. Probably adding a clear or remove button per variable to reset the value could be beneficial
I similarly ran into this and was surprised by it. I interpreted the Vars tab as a request level var since they live within an individual request, but this is just a shortcut to setting a collection level var.
I find this behavior to be unexpected and undesirable. I'd like to be able to set variables that only apply to the given request, yet they apply globally to the entire collection.
I am using a pre-request script to access these vars and am encountering conflicts due to the persistent nature of these bars. Is this always how this feature will behave, or can we expect a change with regard to this? It seems like each scope should be able to have its own vars.
It is possible that my interpretation is incorrect but in which case I would like to understand how the following feature works.
If we go to the Vars section we can define the variables and their values.
In js scripts, we should be able to access these variables/values using getVar
So far so good. However, when unchecking the vars section of the checkbox, my expectation is that the script cannot obtain the value of the variable because in theory the checkbox is unchecked, but even so
getVar
can continue obtaining the value even if it is not checked. This only happens once you check it and uncheck it, the value remains set forever until you restart Bruno and try again first unchecking thegetVar
checkbox will say null.From my point of view, unchecking the checkbox means that the value is cleared(null or even not set). Is it a bug? feature? Or misinterpretation on my part?
The text was updated successfully, but these errors were encountered: