Skip to content

๐Ÿ›ž An automation framework for web testing using Selenium and TestNG. It includes various features and best practices for writing and maintaining automated tests.

Notifications You must be signed in to change notification settings

ashik-e-rabbani/Web-automation-with-selenium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

39 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Web Automation with Selenium Documentation

Project Overview

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.

Project Structure

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.

Project Dependencies

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.

Guidelines and Commit History

Guidelines with Commit IDs

  1. Basic Links: Covers basic link interactions like basicLink, partialLink, linkWithAttributes, linkInNewTab, dynamicLink, and redirectLink.

  2. Headless Browsers and Drivers: Explains the usage of headless browsers and drivers.

  3. Download/Upload File in Selenium: Describes how to handle file download and upload in Selenium.

  4. TestNG Test Listeners (Test Suite Level): Demonstrates the usage of TestNG Test Listeners at the test suite level.

  5. Asserts: Soft vs. Hard Asserts: Discusses the differences between soft and hard asserts.

... (and so on)

Additional Topics

  • 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)

Selenium Best Practices and Design Patterns

Page Object Model (POM)

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.

Browser Driver Factory

The Browser Driver Factory is implemented as a design pattern to manage the creation and configuration of web browser drivers dynamically.

Test Utilities

Test utilities are provided to support and simplify the testing process. These utilities enhance code readability and maintainability.

Running Tests in Parallel

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.

Documentation Contributors

For additional details on individual topics, refer to the corresponding commits and their associated documentation.

About

๐Ÿ›ž An automation framework for web testing using Selenium and TestNG. It includes various features and best practices for writing and maintaining automated tests.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages