This project is an automation framework for web testing using Selenium and TestNG. It includes various features and best practices for writing and maintaining automated tests. The project structure is managed using Maven, and it leverages Selenium for browser automation and TestNG for test execution.
The project structure follows Maven conventions and includes the standard Maven directories such as src/main
and src/test
. Key files include:
pom.xml
: Maven Project Object Model (POM) file defining project details, dependencies, and build configurations.src/test/resources/testng.xml
: TestNG XML configuration file specifying test suite details.
The project relies on several external libraries to facilitate testing. Here are the main dependencies specified in the pom.xml
file:
- Selenium: Version 4.11.0
- TestNG: Version 7.5.1
- Log4j: Version 2.17.2
- OpenCSV: Version 5.6
- Allure TestNG: Version 2.17.0
These dependencies provide functionalities for browser automation, testing framework support, logging, CSV handling, and test reporting with Allure.
-
Basic Links: Covers basic link interactions like
basicLink
,partialLink
,linkWithAttributes
,linkInNewTab
,dynamicLink
, andredirectLink
. -
Headless Browsers and Drivers: Explains the usage of headless browsers and drivers.
-
Download/Upload File in Selenium: Describes how to handle file download and upload in Selenium.
-
TestNG Test Listeners (Test Suite Level): Demonstrates the usage of TestNG Test Listeners at the test suite level.
-
Asserts: Soft vs. Hard Asserts: Discusses the differences between soft and hard asserts.
... (and so on)
-
Using JavaScriptExecutor: Utilizes the JavaScriptExecutor interface for executing JavaScript code in Selenium.
-
Allure Screenshots: Introduces the capturing of screenshots with Allure.
-
TestNG DataProviders: Explains the usage of TestNG DataProviders for data-driven testing.
-
Parallel Test execution: Use the paraller driver initalization thru ThreadLocal so each test class will have different driver thread to perform individual actions.
... (and so on)
The project follows the Page Object Model (POM) design pattern for structuring Selenium tests. Page Object Classes encapsulate web page details and functionalities, providing better code organization and reusability.
The Browser Driver Factory is implemented as a design pattern to manage the creation and configuration of web browser drivers dynamically.
Test utilities are provided to support and simplify the testing process. These utilities enhance code readability and maintainability.
Tests are designed to run in parallel using the parallel driver initialization through ThreadLocal. This ensures that each test class has a different driver thread for performing individual actions.
-
Author: Ashik E Rabbani - LinkedIn
-
Contributors: [Are you one of them? Let's dive!]
For additional details on individual topics, refer to the corresponding commits and their associated documentation.