project-root
│
├── src
│ ├── main
│ │ └── java
│ │ └── com.projectname.pages (Page Objects)
│ │ ├── Page01.java
│ │ ├── Page02.java
│ │ └── Page03.java
│ │ └── com.projectname.utils (Utility classes)
│ │ ├── DriverManager.java
│ │ ├── TestUtil.java
│ │ └── ConfigReader.java
│ ├── test
│ └── java
│ └── com.projectname.tests (Test Cases)
│ ├── Test01.java
│ ├── Test02.java
│ └── Test03.java
│ └── com.projectname.base (Base Test Class)
│ └── BaseTest.java
│
├── resources
│ ├── config.properties
│ └── log4j.properties
│
├── pom.xml (Maven configuration file)
└── testng.xml (TestNG configuration file)
This package contains classes that represent the pages of the application under test. Each class contains the locators and methods to interact with the elements on that particular page.
Utility classes are helpers that provide common functions used across different parts of the project.
-
DriverManager.java:
- Responsible for setting up and managing the WebDriver instance.
- Methods to initialize and quit the driver, manage browser configurations, etc.
-
TestUtil.java:
- Contains utility methods for common actions like taking screenshots, waiting for elements, or handling alerts.
-
ConfigReader.java:
- Reads configuration settings from the
config.properties
file. - Provides methods to fetch environment-specific data like URLs, credentials, etc.
- Reads configuration settings from the
This package contains the actual test cases that will be executed. Each test class corresponds to a particular feature or a set of related functionalities.
This package contains the base class that all test classes extend. It provides common setup and teardown methods for tests.
- BaseTest.java:
- Contains methods annotated with
@BeforeSuite
,@BeforeTest
,@AfterTest
, and@AfterSuite
. - Sets up the WebDriver, loads the configuration, and quits the driver after tests are completed.
- Contains methods annotated with
Configuration files store settings and data that can be used throughout the project.
-
config.properties:
- Contains key-value pairs for configuration settings like base URLs, browser types, timeout values, etc.
-
log4j.properties:
- Configures logging for the project. Defines how logs will be captured and where they will be stored.
This file is used to manage project dependencies, plugins, and build configurations.
- pom.xml:
- Defines dependencies like Selenium, Appium, TestNG, etc.
- Configures plugins for reports, build lifecycle, etc.
This file is used to define test suites, groups, parameters, and execution sequences.
- testng.xml:
- Specifies which tests to run, the order of execution, and other TestNG settings like parallel execution.
🌟 Feel free to fork, clone, and contribute!