This repository contains automated test scripts for browser testing on Android and iOS mobile devices using Appium and Selenium. The tests are designed to run on mobile devices, utilizing the Chrome browser for Android and Safari browser for iOS.
Before running the tests, ensure you have the following installed on your system:
- Java Development Kit (JDK) - Download Here
- Node.js - Download Here
- Appium - Installation Guide
- Android Debug Bridge (ADB) - Required for Android devices. Install via Android Studio or stand-alone here
- Xcode (For iOS) - Required for iOS devices, available from the Mac App Store.
- ApiDemos-debug.apk - Download Here
- UIKITCatalog.app - Download Here
Clone the repository:
git clone https://github.com/okiabrian123/Automation-test-script-mobile-Application-with-Appium-in-Java.git
cd Automation-test-script-mobile-Application-with-Appium-in-Java
npm install
For testing on iOS, you need to configure WebDriverAgent to work with Safari. Follow the instructions from the official Appium documentation for setting up WebDriverAgent on iOS, or follow my instructions here.
For iOS, ensure WebDriverAgent is properly configured for testing.
- Connect your Android device with USB debugging enabled.
- Add Android application to folder apps
Example:
Automation-test-script-mobile-Application-with-Appium-in-Java/apps/ApiDemos-debug.apk
- Launch Appium on your second terminal
appium
- Run the tests for Android
Example:
- Android version = 14
- Device name = OPPO A57
- Android apps = ApiDemos-debug.apk
mvn -Dtest=TestAndroid test -DandroidVersion=14 -DandroidName="OPPO A57" -DandroidApp="ApiDemos-debug.apk"
Note: you can use absolute path directly, example:
mvn -Dtest=TestAndroid test -DandroidVersion=14 -DandroidName="OPPO A57" -DandroidApp="/Users/username/AutomationTest/Automation test script mobile Application/apps/ApiDemos-debug.apk"
- Connect your iOS device with Developer mode enabled.
- Add iOS application to folder apps
Example:
Automation-test-script-mobile-Application-with-Appium-in-Java/apps/UIKITCatalog.app
- Launch Appium on your second terminal
appium
- Run the tests for iOS(simulator)
Example:
- iOS version = 14
- Device name = iPhone SE (3rd generation)
- iOS apps = UIKITCatalog.app
mvn -Dtest=TestiOS test -DiosVersion="17.4" -DiosName="iPhone SE (3rd generation)" -DiosApp="UIKITCatalog.app"√
Note: you can use absolute path directly, example:
mvn -Dtest=TestiOS test -DiosVersion="17.4" -DiosName="iPhone SE (3rd generation)" -DiosApp="/Users/username/AutomationTest/Automation test script mobile Application/apps/UIKITCatalog.app"
Automation-Test-Mobile-Browser/
.
|
├── drivers/ # Folder to store your Chromedriver for Android
├── src/test/java/org.example
│ ├── TestAndroid.java # Test scripts
│ ├── TestiOS.java # Test scripts
├── pom.xml # Maven project file for dependencies, plugin and profile
└── README.md # Project documentation
Feel free to submit pull requests for enhancements or bug fixes. Please ensure code changes are properly tested.