Pre-defined Variables and Text Extraction | Bondar Academy
Course: AI-based testing with testRigor
Module: Reusability and Optimization
Instructor: Artem Bondar
Lesson Summary
This lesson focuses on how to grab text values from a web page and save them into variables for later use in tests. It also covers predefined variables available in the test trigger. Key Concepts Variable Creation: Instead of hardcoding values, you can grab the text from buttons or other elements and store them in variables. Assertions: Use stored variables to make assertions in your tests, ensuring that dynamic values match expected outcomes. Example 1: Button Text Assertion To compare button texts: Navigate to the form layouts page. Grab the value from the button next to "Remember Me" using the prompt: grab value from button and save it as button text . Make an assertion to check if button text contains "submit". Run the test to validate the assertion. Example 2: Grabbing Values by Template To grab a username from a table: Navigate to the smart table page. Use the prompt: grab value by template to find a username starting with "@" followed by three letters. Make an assertion to check if the stored value equals the expected username. Predefined Variables Utilize predefined variables such as username and password for common tasks. For date-related tests, variables like today day of month can simplify date selection in scripts. In summary, use grab value to store text in variables, utilize templates for partial matches, and leverage predefined variables for efficiency in date handling.