Loop Through Table Rows Using JavaScript | Bondar Academy
Course: AI-based testing with testRigor
Module: Advanced Tricks and Techniques
Instructor: Artem Bondar
Lesson Summary
In this lesson, we explore how to utilize pure JavaScript within the Test Trigger framework. This is particularly useful when the built-in functionalities do not suffice for specific conditions. Prerequisites: Familiarity with JavaScript is essential. If you're new to JavaScript, it's recommended to complete the JavaScript Fundamentals module at Bonder Academy before proceeding. Key Concepts: Testing Table Filters: We demonstrate how to test a filtering functionality in a smart table by validating that all rows display a specific age when filtered. Handling Delays: A delay is introduced after inputting the age to ensure the table has time to update before the test retrieves values. Using JavaScript for Validation: JavaScript is employed to loop through table rows and validate that each row contains the expected value. Steps to Implement JavaScript in Test Trigger: Navigate to the smart table page and input the desired age. Introduce a delay (e.g., setTimeout ) to allow the table to update. Use JavaScript to grab values from the table and validate them. Utilize the Test Trigger Interface to interact with stored values using methods like getStoredValue and execute . In conclusion, this lesson illustrates how to effectively integrate JavaScript into Test Trigger for advanced testing scenarios, allowing for more robust validation of application functionalities.