Global Variables | Bondar Academy
Course: AI-based testing with testRigor
Module: Reusability and Optimization
Instructor: Artem Bondar
Lesson Summary
This lesson focuses on global variables in testing, which allow for the reuse of variable values across different test cases. Key Concepts Global Variables: Variables defined globally that can be accessed in multiple test cases. Test Data Section: Where global variables are created and managed. Creating Global Variables To create a global variable: Navigate to the Test Data section. Click the Add button to create a new variable. Define the variable name and value. For example: superuseremail with value [email protected] superuserpassword with a hidden value for security. Using Global Variables in Tests Once created, global variables can be referenced in your tests: Replace hard-coded values with global variables using the syntax stored value . Example usage in a test case: stored value: superuseremail stored value: superuserpassword Conclusion Using global variables simplifies test management by avoiding repetitive hard-coded values. They can be found under the Test Data section, and accessed in tests using the stored value syntax. In summary, global variables are essential for maintaining consistency and efficiency in testing.