A cross-platform TestNG + Appium mobile test automation project for the ARC Blood application, supporting both Android and iOS on real devices.
src/
├── main/java/com/cube/qa/arcblood/
│ ├── config # TestConfig, ConfigLoader
│ ├── pages # Page Object Model (POM)
│ └── utils # DriverManager, BasePage
├── test/java/tests # Test classes (TestNG)
└── test/resources/
└── apps/ # APK & IPA binaries (not committed)
├── android/
└── ios/
testng.xml # Combined test suite (parallel)
testng-android.xml # Android-only suite
testng-ios.xml # iOS-only suite
pom.xml # Maven configuration
.gitignore # Excludes platform-specific & large files
- Java 17+
- Maven
- Appium Server running (
appium
or Appium Desktop) - Real Android or iOS device connected
build
,udid
, andplatform
set via testng or CLI
<parameter name="platform" value="android"/>
<parameter name="build" value="src/test/resources/apps/android/app.apk"/>
<parameter name="udid" value="YOUR_DEVICE_UDID"/>
<parameter name="fullReset" value="true"/>
Set fullReset
to "true"
to install a fresh app each time, or "false"
to retain app data.
Each page defines element locators using a primary + fallback approach. For example:
welcomeTitleLocators = List.of(
By.id("com.cube.arc.blood:id/title")
);
Only the first working and visible locator will be used. This increases resilience across versions/platforms.
Runs both Android & iOS tests:
mvn test
Android:
mvn test -DsuiteXmlFile=testng-android.xml
iOS:
mvn test -DsuiteXmlFile=testng-ios.xml
mvn test -Dplatform=android -Dbuild=path/to.apk -Dudid=your_device_udid -DfullReset=true
Defined in testng.xml
with:
<suite name="Cross Platform Suite" parallel="tests" thread-count="2">
This allows Android and iOS tests to run simultaneously, each on a dedicated thread/device.
- App binaries:
*.apk
,*.ipa
,*.app
- Build output:
/target/
,/build/
,/out/
- IDEs:
.idea/
,.vscode/
- Logs:
*.log
,appium.log
- Test reports:
/surefire-reports/
,/failsafe-reports/
Ensure binaries are placed locally at:
src/test/resources/apps/android/
andsrc/test/resources/apps/ios/
The framework includes safe, thread-aware logging like:
[ANDROID | Thread-1] ▶ STARTING TEST: testWelcomeLoginButtonAppears
This helps distinguish test output during parallel runs.
- Pages Directory: Add locators and functions in here
- testData Directory: Model data and store within here
- BaseTest.java: Initialise pages within here. Also add helper functions for repeated flows
- HelperFunctions.java: Helper functions that are likely to repeat across projects
- Tests Directory: Tests written within here
- testng-platform.xml: Configure the environments for running the tests
- deviceHelpers Directory: Contains platform specific helpers that can work on multiple projects
- ✅ You do not need to keep Xcode open to test on iOS
- ✅ Real devices must be connected and authorized via
adb devices
(Android) orxcrun xctrace list devices
(iOS) - ❌ APK and IPA files are not committed to version control
- 🧠 The framework automatically logs which locator fails or succeeds
- App path incorrect? Double check the full path exists locally
- Device not connected? Run:
adb devices
for Androidxcrun xctrace list devices
for iOS
- Tests not running on iOS?
- Verify that the device is provisioned in App Developer Portal and then run a new build
- App fails to start? Confirm Appium logs for errors and package/activity names
Happy Testing! 🧪💥