Giter Site home page Giter Site logo

paralleltestexecutiontutorial's Introduction

Parallel Test Execution with Selenium and TestNG

This repository provides a reference implementation for running parallel tests using Selenium WebDriver and TestNG. It is intended for those who are new to parallel test execution and want a simple example to get started.

Table of Contents

Introduction

Parallel test execution allows you to run multiple tests simultaneously, reducing the overall time required to complete your test suite. This repository demonstrates how to configure and execute parallel tests using Selenium WebDriver and TestNG.

Prerequisites

Before you begin, ensure you have the following installed:

  • Java Development Kit (JDK) 8 or higher
  • Apache Maven
  • An IDE such as IntelliJ IDEA or Eclipse

Project Structure

The repository is organized as follows:

.
├── src
│ ├── main
| | ├── DataProvider
| | | └── Data.java
| | ├── Page
| | | └── BaseTest.java
│ └── test
│ | ├── java
│ │ | ├── Parallel
│ │ │ | ├── ParallelClassA.java
│ │ │ | ├── ParallelClassB.java
│ │ │ | ├── ...
│ │ │ | ├── ...
│ │ │ | └── ParallelClassJ.java
│ └── resources
│ └── testng.xml
├── pom.xml
└── README.md
  • ParallelClassA.java , ParallelClassB.java , etc. : Example test classes.
  • testng.xml: Configuration file for TestNG, specifying parallel execution settings.

Setup Instructions

  1. Clone the Repository:

    git clone https://github.com/Animesh9/ParallelTestExecutionTutorial.git
    cd parallel-tests-selenium-testng
    
  2. Install Dependencies:

    Ensure you have Maven installed and run the following command:

    mvn clean install
    

Running the Tests

The testng.xml file is configured to run tests in parallel. You can modify the parallel and thread-count attributes to control the parallel execution behavior.

Customization

Modifying Parallel Execution:

Edit the testng.xml file to adjust parallel execution settings:

<suite name="Parallel Test Suite" parallel="classes" thread-count="5">
    <test name="ParallelTestExecutionTutorial">
        <classes>
            <class name="com.example.tests.ParallelClassA"/>
            <class name="com.example.tests.ParallelClassB"/>
        </classes>
    </test>
</suite>

Adding New Tests:

Create new test classes in the src/test/java/Parallel directory and update the testng.xml file accordingly.

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes. Ensure your code adheres to the existing style and include appropriate tests.

paralleltestexecutiontutorial's People

Contributors

animesh9 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.