Learn how to group Selenium tests using TestNG annotations, configure setup/teardown methods, and run tests with Extent Reports in a hybrid framework.
Key Takeaways
- TestNG groups allow flexible and efficient test execution by categorizing tests.
- Setup and teardown methods must also be grouped to run correctly with grouped tests.
- The master group is useful for running all tests in one suite.
- Groups can be included or excluded in the XML configuration for targeted test runs.
- Data-driven tests are often run as a separate group for better management.
Summary
- Introduction to grouping test cases in Selenium with Java using TestNG groups annotation.
- How to assign tests to groups like sanity, regression, data-driven, and master for selective execution.
- Adding groups to setup and teardown methods to ensure proper execution across grouped tests.
- Creating and configuring groups in the TestNG XML file for flexible test suite execution.
- Explanation of the master group that includes all tests for full suite runs.
- Demonstration of adding multiple groups to a single test using curly braces syntax.
- Using include and exclude tags in XML to control which groups to run or skip.
- Best practices for managing data-driven tests separately within the grouping framework.
- Importance of specifying groups in base classes and setup/teardown methods.
- Overview of running grouped tests and how to enable or disable tests dynamically.











