How sarankumar-primesoft/webautomation works
Project Type and Purpose
• Type: Automated end-to-end web-testing framework for an OTT application
• Purpose: Use Selenium WebDriver + TestNG to drive browser tests, log events via Log4j, and produce HTML reports via Extent Reports, all managed by Maven.
File Structure
• Configuration folder / config.properties: Holds environment settings (browser, URL, timeouts).
• src/main/resources/log4j2.xml: Logging configuration.
• src/test/java/base/BaseClass.java: Initializes WebDriver & test setup/teardown.
• src/test/java/com/configure/Factory.java, config.java: Reads config and instantiates browser or test data objects.
• src/test/java/com/pom/*.java: Page Object Model classes, each mapping a UI page.
• src/test/java/com/tests & videoplayback_cases: TestNG test classes invoking POM methods.
• src/test/java/com/listeners: TestNG listeners (retry logic, test info capture, annotation hooks).
• pom.xml & testng.xml: Dependency management, build & test execution.
• Logs and Reports directories: /logs, /extent-report, /test-output – runtime outputs.
README for Additional Insights
• Confirms use of Java, Maven, Selenium, TestNG, Extent Reports, Log4j.
• Highlights POM for maintainability, cross-browser support, and Maven-based execution.
Main Components & Their Interactions
a. Test Execution Layer
– Maven Surefire Plugin invokes TestNG using testng.xml.
– TestNG Driver executes test classes (TC_1…TC_11, TC_Playback).
b. Configuration Module
– Factory reads config.properties → exposes browser type, base URL, credentials.
c. Core Test Framework
– BaseClass: WebDriver lifecycle (init, teardown), reads Factory.
– POM Classes: Encapsulate UI element locators + actions.
– Test Cases: Use BaseClass & POM methods to drive test scenarios.
d. Observability & Reporting
– Log4j 2: Logs each step to automation-log.log per log4j2.xml settings.
– TestNG Listeners: AnnotationListeners, RetryFailedTC, Testinfo intercept test events.
– Extent Reports: Collected by ExtentManager/ExtentReport classes → HTML in /extent-report.
e. External Dependencies
– Browser Drivers (ChromeDriver, GeckoDriver)
– OTT Web Application under test
Architectural Patterns & Design Principles
• Page Object Model (POM) – separates page structure & test logic.
• Factory Pattern – encapsulates creation of WebDriver/config objects.
• Singleton – ExtentManager to manage one report instance.
• Observer (Listener) – TestNG listeners capture test lifecycle events.