Variables in Script
1. pm.globals
- Use-case: Defines a global variable.
- Example: pm.globals.set(“variable_key”, “variable_value”);
2. pm.collectionVariables
- Use-case: Defines a collection variable.
- Example: pm.collectionVariables.set(“variable_key”, “variable_value”);
3. pm.environment
- Use-case: Defines an environment variable in the currently selected environment.
- Example: pm.environment.set(“variable_key”, “variable_value”);
4. pm.variables
- Use-case: Defines a local variable.
- Example: pm.variables.set(“variable_key”, “variable_value”);
5. unset
- Use-case: Removes a variable.
- Example: pm.environment.unset(“variable_key”);
Navigating API Testing with Postman
API(Application Programming Interface) testing plays a pivotal role in the software development lifecycle, ensuring the seamless functionality of APIs and safeguarding against potential issues. Postman, a comprehensive API development and testing tool, offers a range of features to streamline and enhance the testing process.
Table of Content
- Navigating API Testing with Postman
- Diverse Approaches to API Testing
- Writing Test Scripts in Postman
- Variables in Script
- Dynamic Variables in Postman
- Leveraging Postman Sandbox
- Automation with Postbot
- Postbot for Intelligent Test Generation
- Template-driven Testing
- Validating Responses
- Test Collections and Folders
- Debugging Tests
- Conclusion
Contact Us