I want to use a global variable to be used in the request like:
I created this variable in the variable quick look via the eye symbol in Postman v7.31.1 (Linux)
name: switcher -> value web-2.0.0
I want to write some tests and read out my soap statement as normal
var responseJson = xml2Json(responseBody)
… some thing more is going on
so the request-url is
console.log(request.url); --> http://mydummyadress-web-2.0.0/ws
I simple want to use to switch to another version of my api
therefore I want to simple overwrite this global variable
The aspected url should be:
console.log(request.url); --> http://mydummyadress-web-1.0.0/ws
but it is still the web-2.0.0
Therefore I did some simple variable log check with results I don’t understand:
console.log("Init Variable: ", pm.globals.get(“switcher”)); --> Init Variable: web-2.0.0
console.log(“changed to :”, pm.globals.get(“switcher”)) --> changed to : web-1.0.0
console.log(“do unset”) --> do unset
console.log(“Read Again”, globals.switcher); --> Read Again web-2.0.0
console.log("reread Variable: ", pm.globals.get(“switcher”)) --> reread Variable: undefined
console.log("reread one more time Variable: ", globals.switcher) --reread one more time Variable: web-2.0.
What is the difference of setting and requesting this variable?
How can I get the change in my url for resending.?
Thanks a lot.