To run my whole collection, I need to generate an OAuth2 token. Because I want to run the collection by just pressing Run, and do not want to bother with generating a token manually for each folder, I have chosen to do this with a pre-request script. Everything is running like a charm, I am getting the Oauth2 token and when I run the tests one by one manually, the token is saved as an environment variable for the next requests to access and use it. That is great, BUT when I run the whole collections, sometimes it will seem that the variable is not being saved / or the following requests are not accessing it. Using setTimeout() seems to be working most of the time, but not always.
Have you experienced such a behavior? Am I missing something?
Thanks in advance!