Skip to content

This repository contains a Tutorial for Page Object Model (POM) design pattern implementation using Selenium WebDriver and Java for automated testing of applications.

Notifications You must be signed in to change notification settings

rajatt95/Tutorial_YT_Rajat_DesignPattern_POM_Selenium_Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


💻 Tutorial | Page Object Model (POM)

Selenium Java

IntelliJ IDEA Maven TestNG Page Object Model

📑 Table of Contents

📖 Introduction

This repository contains a Tutorial for Page Object Model (POM) design pattern implementation using Selenium WebDriver and Java for automated testing of applications.

🎥 Video Tutorial

Tutorial | POM | Selenium WebDriver + Java

Click on the image above to watch the tutorial.

🛠️ Prerequisites

  • Java JDK (v11 or higher recommended)
  • Maven (v3.8.7 or higher recommended)

▶️ Getting Started

  1. Clone the repository:

    git clone https://github.com/rajatt95/Tutorial_YT_Rajat_DesignPattern_POM_Selenium_Java
  2. Navigate to the project directory:

    cd Tutorial_YT_Rajat_DesignPattern_POM_Selenium_Java
  3. Install dependencies:

    mvn clean install

🚀 Running Tests

You can execute the tests using the test runner class located in src/test/java:

  • Run All Tests: Execute the testng.xml file to run all the tests.

  • Run Specific Test: The test runner class allows you to run specific test methods if needed.

  • Execute tests using Maven:

    mvn clean test

📁 Project Structure

The tests follow a modular and maintainable structure:

|-- src
|     |-- main
|          |-- java
|              |-- tutorial.POM.pages
|                  |-- _02_Without_PageFactories
|                      |-- HomePage
|                      |-- LoginPage
|                  |-- _03_With_PageFactories
|                      |-- HomePage
|                      |-- LoginPage
|                  |-- _04_BuilderPattern
|                     |-- HomePage
|                      |-- LoginPage
|                 |-- _05_FluentInterface
|                      |-- HomePage
|                      |-- LoginPage
|                 |-- _06_HandleComponents
|                      |-- components
|                          |-- AppHeader
|                      |-- HomePage
|                      |-- LoginPage
|     |-- test
|          |-- java
|              |-- tutorial.POM
|                  |-- base
|                    |-- BaseTest
|                  |-- tests
|                      |-- Test_02_Login_POM_Without_PageFactories
|                      |-- Test_03_Login_POM_With_PageFactories
|                      |-- Test_04_Login_POM_BuilderPattern
|                      |-- Test_05_Login_POM_FluentInterface
|                      |-- Test_06_Login_POM_Components
|-- testng.xml
  • src/main/java/tutorial.POM.pages: Contains the Page Object Model (POM) classes representing web pages and their elements.
  • src/test/java/tutorial.POM.base: Contains the Base for every test (setup and tearDown methods).
  • src/test/java/tutorial.POM.tests: Contains the actual test files. You can organize your tests into subdirectories as needed.
  • testng.xml: Tests execution configuration file

⚙️ Configuration

  • Modify testng.xml for Tests execution configuration settings.
  • Customize BaseTest for setup and tearDown methods (Change browser for tests execution).

🔭 Other Projects

  • Java - Selenium Appium Rest Assured

  • JavaScript - Cypress Playwright

  • Python - Requests

📄 Technical Documents

  • Google Drive
  • GitHub Repository

📧 Contacts

  • Email
  • GitHub Profile
  • GitHub Page
  • LinkedIn
  • Topmate
  • Telegram
  • Instagram
  • YouTube
  • WhatsApp Community
  • WhatsApp Channel

Feel free to reach out if you have any questions, or suggestions, or just want to chat!

Thanks for visiting my GitHub profile! 😊

rajatt95