Ready-to-use UI Test Automation Architecture using Java and Selenium WebDriver.

Overview

Selenium Test Automation Boilerplate

Ready-to-use UI Test Automation Architecture using Java and Selenium WebDriver.

Languages and Frameworks

The project uses the following:

Project Structure

selenium-test-automation-boilerplate/
├─ .github/
│  ├─ workflows/
│  │  ├─ test-execution.yml
├─ gradle/
│  ├─ wrapper/
│  │  ├─ gradle-wrapper.jar
│  │  ├─ gradle-wrapper.properties
├─ report/
│  ├─ screenshot/
├─ script/
│  ├─ install_chrome.sh
├─ src/
│  ├─ main/
│  │  ├─ java/
│  │  │  ├─ io/
│  │  │  │  ├─ github/
│  │  │  │  │  ├─ tahanima/
│  │  │  │  │  │  ├─ config/
│  │  │  │  │  │  │  ├─ Configuration.java
│  │  │  │  │  │  │  ├─ ConfigurationManager.java
│  │  │  │  │  │  │  ├─ package-info.java
│  │  │  │  │  │  ├─ data/
│  │  │  │  │  │  │  ├─ login/
│  │  │  │  │  │  │  │  ├─ LoginData.java
│  │  │  │  │  │  │  ├─ BaseData.java
│  │  │  │  │  │  │  ├─ package-info.java
│  │  │  │  │  │  ├─ driver/
│  │  │  │  │  │  │  ├─ BrowserFactory.java
│  │  │  │  │  │  │  ├─ DriverManager.java
│  │  │  │  │  │  │  ├─ package-info.java
│  │  │  │  │  │  ├─ page/
│  │  │  │  │  │  │  ├─ login/
│  │  │  │  │  │  │  │  ├─ LoginPage.java
│  │  │  │  │  │  │  ├─ product/
│  │  │  │  │  │  │  │  ├─ ProductsPage.java
│  │  │  │  │  │  │  ├─ BasePage.java
│  │  │  │  │  │  │  ├─ BasePageFactory.java
│  │  │  │  │  │  │  ├─ package-info.java.java
│  │  │  │  │  │  ├─ report/
│  │  │  │  │  │  │  ├─ ReportManager.java
│  │  │  │  │  │  │  ├─ package-info.java
│  │  ├─ resources/
│  │  │  ├─ general.properties
│  ├─ test/
│  │  ├─ java/
│  │  │  ├─ io/
│  │  │  │  ├─ github/
│  │  │  │  │  ├─ tahanima/
│  │  │  │  │  │  ├─ login/
│  │  │  │  │  │  │  ├─ LoginTest.java
│  │  │  │  │  │  ├─ util/
│  │  │  │  │  │  │  ├─ DataProviderUtil.java
│  │  │  │  │  │  ├─ BaseTest.java
│  │  │  │  │  │  ├─ TestListener.java
│  │  ├─ resources/
│  │  │  ├─ testData/
│  │  │  │  ├─ login/
│  │  │  │  │  ├─ login.csv
├─ .gitignore
├─ build.gradle
├─ gradlew
├─ gradlew.bat
├─ README.md
├─ settings.gradle

Project Architecture

Config

The project uses general.properties file to map all the global parameters such as browser and base url. All the relevant classes to read the parameters are provided in the config package.

Data

The project reads test data from csv files. The test data properties are modeled in terms of entities and the data package handles this. For convenience, there is an example class - LoginData.java to demonstrate the usage.

Driver

The project uses Selenium WebDriver to automate user workflows for web-based applications as part of automated testing. The driver package contains all the necessary initialization logic for WebDriver.

Page

The project uses Page Object Model to capture all the relevant UI components and functionalities of a web page. The page package provides all the classes to achieve this. For convenience, there is an example class - LoginPage.java to demonstrate the usage.

Report

The project uses Extent Reports to provide test reporting functionalities. The report package contains the relevant class.

Test

LoginTest.java demonstrates an example test script.

Workflow

The project uses GitHub Actions to run the selenium tests when an update is made to the main branch of the repo in GitHub.

You might also like...

A sample repo to help you emulate network control using CDP in Java-TestNG automation test on LambdaTest. Run Selenium tests with TestNG on LambdaTest platform.

How to emulate network control using CDP in Java-TestNG automation test on LambdaTest Environment Setup Global Dependencies Install Maven Or Install M

Oct 23, 2022

A sample repo to help you set device mode using CDP in Java-TestNG automation test on LambdaTest. Run Selenium tests with TestNG on LambdaTest platform.

How to set device mode using CDP in Java-TestNG automation test on LambdaTest Environment Setup Global Dependencies Install Maven Or Install Maven wit

Jul 13, 2022

A collection of bite size examples for using chrome DevTools protocol commands with Selenium Webdriver v4.

selenium-devtools-guide A collection of bite size examples for using chrome DevTools protocol commands with Selenium Webdriver v4. Chrome Devtools Pro

Aug 12, 2021

A sample repo to help you capture JavaScript exception for automation test in Java-TestNG on LambdaTest. Run Selenium tests with TestNG on LambdaTest platform.

How to capture JavaScript exception for automation test in Java-TestNG on LambdaTest Environment Setup Global Dependencies Install Maven Or Install Ma

Jul 13, 2022

A sample repo to help you set geolocation for automation test in Java-TestNG on LambdaTest. Run Selenium tests with TestNG on LambdaTest platform.

How to set geolocation for automation test in Java-TestNG on LambdaTest Environment Setup Global Dependencies Install Maven Or Install Maven with Home

Jul 13, 2022

A sample repo to help you handle basic auth for automation test in Java-TestNG on LambdaTest. Run Selenium tests with TestNG on LambdaTest platform.

How to handle basic auth for automation test in Java-TestNG on LambdaTest Environment Setup Global Dependencies Install Maven Or Install Maven with Ho

Jul 13, 2022

Selenium Webdriver: Page Object Model (POM) With Page Factory

Prepare Web Testing Instance or Environment Selenium Webdriver: Page Object Model (POM) With Page Factory Prerequisite software Download & Install JDK

Oct 18, 2022

BDD framework for automation using Selenium Cucumber and TestNg

BDD framework for automation using Selenium Cucumber and TestNg

Selenium Framework with Cucumber BDD framework for automation using Selenium Cucumber and TestNg The framework has following features Modular Design M

Jan 20, 2022

An e-commerce automation project of Selenium TestNG using Page Object Model

An e-commerce automation project of Selenium TestNG using Page Object Model

Selenium-POM-TestNG Prerequisites Install jdk 8 or any LTS version Configure JAVA_HOME and GRADLE_HOME Download Allure 2.17.2 and configure environmen

Aug 4, 2022
Owner
Tahanima Chowdhury
Software Engineer II, QA @ Therap (BD) Ltd. | Blogger @ Tahanima's Blog
Tahanima Chowdhury
A sample repo to help you run automation test in incognito mode in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to run automation test in incognito mode in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - htt

null 12 Jul 13, 2022
A sample repo to help you handle cookies for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to handle cookies for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - https:

null 13 Jul 13, 2022
A sample repo to help you set geolocation for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to set geolocation for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - https

null 12 Jul 13, 2022
A sample repo to help you capture JavaScript exception for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to capture JavaScript exception for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Wi

null 12 Jul 13, 2022
A sample repo to help you find an element by text for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to find an element by text for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows

null 12 Jul 13, 2022
A sample repo to help you emulate network conditions in Java-selenium automation test on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to emulate network conditions in Java-selenium automation test on LambdaTest Prerequisites Install and set environment variable for java. Windows

null 12 Jul 13, 2022
A sample repo to help you use relative locators for automation test in Java-TestNG on LambdaTest. Run Selenium tests with TestNG on LambdaTest platform.

How to use relative locators for automation test in Java-TestNG on LambdaTest Environment Setup Global Dependencies Install Maven Or Install Maven wit

null 11 Jul 13, 2022
A sample repo to help you use CDP console in Java-TestNG automation test on LambdaTest. Run Selenium tests with TestNG on LambdaTest platform.

How to use CDP console in Java-TestNG automation test on LambdaTest Environment Setup Global Dependencies Install Maven Or Install Maven with Homebrew

null 11 Jul 13, 2022
This repository contains example codes which will help you to know how to use selenium webdriver.

❓ What is this Repository about? This repo has example codes with Selenium 4 features. Websites used for testing are: automationpractice.com, saucedem

Mohammad Faisal Khatri 86 Dec 30, 2022
A Java architecture test library, to specify and assert architecture rules in plain Java

ArchUnit is a free, simple and extensible library for checking the architecture of your Java code. That is, ArchUnit can check dependencies between pa

TNG Technology Consulting GmbH 2.5k Jan 2, 2023