How thangarajtk/appium-mobileautomationframework works
Project type and purpose
• This is a Java-based Appium Mobile Automation Framework for testing native apps and mobile browsers on Android and iOS.
• It leverages TestNG, Page Object Model, custom annotations, parallel execution, and supports video/screenshot capture.
File structure
• Top-level: pom.xml, checkstyles, resource files, testng XMLs.
• src/main/java/com/automate:
• constants, enums, customexceptions, customannotations – core metadata and error handling
• driver (factory + manager) – AppiumDriver instantiation, platform/device management
• entity – POJOs for test data
• factories, utils (configloader, dataprovider, screenshot, screenrecording) – support services
• listeners, reports – TestNG listeners and ExtentReports integration
• pages & pages/screen – Page Object Model classes and generic screen actions
• src/test – TestNG test classes and resources: config.json/properties, Excel data, APK, drivers, testng.xml profiles.
Key architectural insights from README
• Page Object Model design
• Ability to start/stop Appium server programmatically (AppiumServiceBuilder)
• Parallel test execution on emulators and real devices
• Configurable logging, screenshot & video capture
• Data-driven tests via Excel
• Retry logic and custom annotations for metadata
a. Main components
1. Test Runner Layer
• TestNG & TestNG XMLs (parallel/sequential execution)
2. Framework Core
• Config Loader (PropertyUtils / JsonUtils)
• Driver Manager & Factory
• Appium Server Manager (AppiumServiceBuilder & AppiumDriverLocalService)
• Custom Annotations & Listeners (retry, transform, logger hooks)
3. Page Object Layer
• Page classes (LoginPage, GoogleSearchPage, etc.)
• ScreenActions base class
4. Utilities & Services
• DataProviderUtils / ExcelUtils
• ScreenshotService & Utils
• ScreenRecordingService & Utils
• DecodeUtils, TestUtils
5. Reporting
• ExtentReportManager & ExtentReportLogger
6. External / Infrastructure
• Appium Server (local or sauce labs)
• Mobile Device (Emulator or Real Device)
• Android SDK / iOS dependencies
• Test Data Storage (Excel file, config.json, config.properties)
b. Relationships & interactions
• Test Runner reads TestNG XML → invokes tests in BaseTest
• BaseTest → loads config via Config Loader → instructs Appium Server Manager to start server
• Driver Manager uses Driver Factory → creates AppiumDriver (AndroidDriver / IOSDriver) → connects to Appium Server
• Tests call Page Objects → Page Objects use driver to execute UI actions on device
• Utilities (DataProvider) supply test data from Excel/JSON → Tests
• Listeners capture test events → invoke ScreenshotService & ScreenRecordingService → store artifacts
• Reporting hooks in Listeners → push results to ExtentReportManager → generate HTML reports
• After suite/test → Appium Server Manager stops the server
c. Architectural patterns & principles
• Layered architecture: separation of concerns (Test Runner / Framework Core / Page Objects / Utilities)
• Factory pattern: DriverFactory & WaitFactory
• Singleton pattern: DriverManager, ConfigLoaders
• Observer pattern: Listeners for TestNG events
• Page Object Model: encapsulate page behaviors
• Dependency injection via factories and utilities
d. Key technologies & frameworks
• Java 8, Maven, TestNG
• Appium Java client, Selenium
• ExtentReports for reporting
• Apache POI for Excel
• JSON / Properties for configuration