Hello
I have gathered a sequence of requests in a collection.
is there a place where I can put initial one time initialization script, which will be run before the execution of the first request for the collection?
(or is there a possibility to add a first empty request, only for its script in Pre-request script?)
Hello @jaxx
You can use pre-request-script. You can get around it by testing for a variable not existing and then executing your initialization logic. Inside that logic, I set/created the variable that I was testing for. My logic is simple and included below. if ( !pm.variables.has(“XXX”) ) {
pm.variables.set(“XXX”,0);
console.log(“Initialize collection”);
}