Could you please check if you somewhere read from pm.globals.get(“switcher”) and write it into a custom made object and property called globals.switcher in your code?
The last lines in your code example tells me that you do not reread the same thing. The following code is from your example but I replaced the comments.
pm.globals.unset(“switcher”); // clears the element within the pm.globals but not other places where you saved it before via pm.globals.get(“switcher”)
console.log("reread Variable: ", pm.globals.get(“switcher”)) // undefined as the element "switcher" got cleared
console.log("reread one more time Variable: ", globals.switcher) // does not not read from the same place, this is not connected to the place where pm.globals.get(“switcher”) points/pointed to
It should be similar to the following example code.
var a = { "switcher" : "some value" };
var b = { "switcher" : a.switcher }; // link b.switcher to the same element in memory as a.switcher
console.log("a.switcher", a.switcher); // expected output "some value"
console.log("b.switcher", b.switcher); // expected output "some value"
delete a.switcher; // delete/remove the link of a.switcher to the place in memory where "some value" is stored
console.log("a.switcher", a.switcher); // expected output undefined
console.log("b.switcher", b.switcher); // expected output "some value"
The weird part
If I start the test affter the first run, the switcher variable is correctly set to web-1.0.0
So how to achieve this for sendNextRequest?