Data Driven Testing with Data Sets | Bondar Academy
Course: AI-based testing with testRigor
Module: Reusability and Optimization
Instructor: Artem Bondar
Lesson Summary
In this lesson, we explore how to utilize data sets for data-driven testing in TestRigor . The focus is on automating a login scenario that involves validating error messages based on different input values. Test Scenario Overview The login page contains fields for email and password . Various invalid inputs trigger specific error messages: Invalid email format: "Email should be real one." Empty password: "Password is required." Password length issues: "Password should contain from four to 50 characters." Instead of creating separate test cases for each scenario, we can consolidate them into a single test case that executes with different data sets. Creating the Data Set To begin, we create a new data set named LoginScreenErrorMessagesValidation with a description for clarity. The following variables are defined: emailInputValue emailErrorMessage passwordInputValue passwordErrorMessage We then create three rows in the data set representing different scenarios: Valid values with no errors. Three-character email and password with respective error messages. No values provided, triggering both error messages. Implementing the Test Case Next, we create a test case that navigates to the login page, inputs values from the data set, and triggers error messages. It is crucial to link the data set to the test case to ensure proper execution. Validation of Error Messages Assertions are added to check for the presence of error messages. We utilize the caption class to validate that the appropriate error messages appear when expected. The test is run, and results are reviewed using a dropdown to select different data sets. Conclusion This lesson demonstrates how to efficiently use data sets in TestRigor to manage repetitive test scenarios with varying inputs, enhancing both testing efficiency and accuracy.