A cross-platform mobile test automation framework for Android and iOS using Appium, Java, and TestNG. This project is designed for both beginners and professionals who want to automate mobile app testing efficiently.
This framework lets you write and run automated tests for Android and iOS apps. It uses the Page Object Model for maintainable test code, and provides detailed reports. You can control emulators and simulators programmatically, and configure everything through property files.
- Page Object Model (POM): Organizes app screens as classes for reusable, maintainable tests.
- Programmatic Emulator/Simulator Control: Start and stop Android emulators and iOS simulators from code.
- SLF4J with Log4j2 Logging: Unified logging to both console and file, configurable via
src/main/resources/log4j2.xml. - TestNG Listeners: Custom listeners for reporting and test lifecycle hooks.
- ExtentReports Integration: Generates rich HTML reports for test runs.
- Configurable Properties: Centralized configuration in
src/test/resources/config/config.properties.
- Appium Java Client: For mobile automation.
- TestNG: For test orchestration and parallel execution.
- SLF4J + Log4j2: For flexible logging.
- ExtentReports: For detailed test reporting.
- Apache Commons IO: For file operations.
/ (project root)
├── logs/
├── src/
│ ├── main/
│ │ ├── java/com/suban/base/
│ │ ├── java/com/suban/config/
│ │ ├── java/com/suban/pages/
│ │ ├── java/com/suban/utils/
│ │ └── resources/
│ └── test/
│ ├── java/com/suban/
│ └── resources/
│ ├── apps/
│ └── config/
├── test-output/
├── pom.xml
├── testng.xml
└── README.md
- logs/: Stores log files generated by Log4j2.
- src/main/java/com/suban/base/: Core classes for server, device, and driver management.
- src/main/java/com/suban/config/: Configuration reader utilities.
- src/main/java/com/suban/pages/: Page Object Model classes for app screens.
- src/main/java/com/suban/utils/: Utility classes for reporting, screenshots, and listeners.
- src/main/resources/: Main configuration files, including
log4j2.xml. - src/test/resources/apps/: Sample app binaries for testing.
- src/test/resources/config/: Test configuration files.
- test-output/: TestNG and ExtentReports output.
-
Install Prerequisites
- Java JDK 11+
- Node.js
- Appium (
npm install -g appium) - Android Studio (for Android tests)
- Xcode (for iOS tests)
-
Clone the Repository
git clone https://github.com/Suban5/AppiumAndroidIOSDemo.git cd AppiumAndroidIOSDemo -
Build the Project
mvn clean install
-
Configure Properties
- Edit
src/test/resources/config/config.propertiesto set device, app, and server details.
- Edit
-
Run Tests
mvn test -
View Reports and Logs
- Test reports:
test-output/ - Logs:
logs/app.log
- Test reports:
For more details, see the code and comments in each directory.