- Introduction
- Video Tutorial
- Prerequisites
- Getting Started
- Running Tests
- Project Structure
- Configuration
- Other Projects
- Technical Documents
- Contacts
This repository contains a Tutorial for Page Object Model (POM) design pattern implementation using Selenium WebDriver and Java for automated testing of applications.
Click on the image above to watch the tutorial.
-
Clone the repository:
git clone https://github.com/rajatt95/Tutorial_YT_Rajat_DesignPattern_POM_Selenium_Java
-
Navigate to the project directory:
cd Tutorial_YT_Rajat_DesignPattern_POM_Selenium_Java
-
Install dependencies:
mvn clean install
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
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
- Modify
testng.xml
for Tests execution configuration settings. - Customize
BaseTest
for setup and tearDown methods (Change browser for tests execution).
Feel free to reach out if you have any questions, or suggestions, or just want to chat!
Thanks for visiting my GitHub profile! 😊