However, this initialization process is not the fastest. For this reason I am looking for a way to only run the setup once when I am coming from a collection. But run it every time a single request is run manually.
I have tried to create a dummy request and set a variable. This way when the collection runs it will call this request, which sets the var ‘isCollection’, which will then stop further initializations from running in the other tests with a if statement. The problem is that the next time I run a single test the variable will still be true so the initialization wont run. I could add a request at the end that sets “isCollection” back to false but then if a user stops execution mid run of the collection then the variable wont be set back to false.
I feel like “detect if the run is coming from a folder or collection vs a single test” should be a out of the box feature but I can’t seem to find any way to accomplish this.
Thanks in advance for responses.