1postman.setGlobalVariable("refresh_token",postman.getResponseHeader("Refresh_token") );
2
1Only accessible within the same collection and
2can not be accessed anywhere else
3COLLECTION variables are available throughout
4the requests in a collection and are independent
5of environments, so do not change based on the selected environment.
6I use collection variables when
7I use single environment like url details.
8We can refer to the variable by using {{}}(double curly brace)
9and it can be used anywhere
1just like variables in Java.
2we can create variables in postman to reuse the value
31.Global variables: accessible everywhere in same workspace
42.Environment variables: accessible in selected environment
53.Collection Variables: belong to the collection itself and
6only accessible within the collection
7