Skip to content

rohit-sinha-lab49/WebSeleniumAutomationFramework

Repository files navigation

Selenium Automation Framework

Build Status License

This is a Selenium Automation Framework built on top of TestNG and integrated with Allure for reporting. This framework is designed to make writing and running automated tests easier and more efficient.

Table of Contents

Features

  • Selenium WebDriver Integration: Easily write and run Selenium tests.
  • TestNG Framework: Leverage the powerful TestNG framework for organizing and executing tests.
  • Allure Reporting: Generate beautiful and detailed test reports with Allure.
  • Page Object Model: Follow the Page Object Model (POM) design pattern for better maintainability.
  • Configurable: Easily configure browser settings, test data, and more through property files.

Getting Started

These instructions will help you set up and run the project on your local machine.

Prerequisites

  • Java 8 or higher
  • Maven 3.6 or higher
  • ChromeDriver (or other WebDriver binaries as needed)
  • Git (optional, for cloning the repository)

Installation

  1. Clone the repository:

    git clone https://github.com/rohit-sinha-lab49/WebSeleniumAutomationFramework.git
    cd WebSeleniumAutomationFramework.git
  2. Install dependencies:

    mvn clean install
  3. Configure WebDriver binaries: Ensure you have the appropriate WebDriver binaries (e.g., ChromeDriver) available in your system's PATH.

Running Tests

  1. Run all tests:

    mvn test
  2. Run a specific test suite:

    mvn -Dtest=<TestSuiteName> test

Generating Reports

After running the tests, you can generate Allure reports.

  1. Generate Allure report:
    allure serve target/allure-results

This command will start a local server and open the Allure report in your default web browser.

Project Structure

├── pom.xml # Project configuration for Maven ├── src │ └── test │ └── java │ └── com │ │ └── example │ │ ├── pages # Page Object Model classes │ │ └── utility # Utility classes │ │ └── tests # Test classes │ └── resources │ └── testng.xml # TestNG configuration file └── allure-results # Allure results directory

Explanation

  • pom.xml: The Maven configuration file.
  • src: The source directory.
    • test: The test source code directory.
      • java: The directory containing Java test files.
        • com/example/pages: The package containing Page Object Model (POM) classes.
        • com/example/utility: The package containing utility classes.
        • com/example/tests: The package containing test classes.
      • resources: The resources directory for test configuration files.
        • testng.xml: The TestNG configuration file.
  • target: The output directory for compiled files and generated reports.
    • allure-results: The directory where Allure test results are stored.

Project Files and Directories

Here's a brief overview of important files and directories in the project:

  • pom.xml: Maven project file containing dependencies and build configurations.
  • src/test/java/com/example/pages: Contains Page Object Model classes, which represent the web pages.
  • src/test/java/com/example/utility: Contains utility classes for common functions and helpers.
  • src/test/java/com/example/tests: Contains the test classes with TestNG test cases.
  • src/test/resources/testng.xml: Configuration file for TestNG.
  • allure-results: Directory where Allure stores test results for generating reports.

Example Usage

To run the tests and generate the Allure report, follow these steps:

  1. Run Tests:

    mvn test
  2. Generate Allure Report:

    allure serve allure-results

This will start a local server and open the Allure report in your default web browser.

By following this structure, you provide a clear and organized overview of your project's layout, making it easier for others to navigate and understand. Feel free to adjust the details according to your project's specific structure and contents.

Contributing

We welcome contributions to improve this project. Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes and commit them (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a pull request.

Please ensure your code adheres to the existing coding standards and includes appropriate tests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

Feel free to modify this template to better fit your project's needs. Add any additional sections or information that might be useful for users and contributors.

//Deploy this on docker //Master/slave configuration [Multi commit execution] //BDD conversion //Send report on Teams using teams plugin

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published