Skip to content

okiabrian123/Automation-test-script-mobile-Application-with-Appium-in-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automation Test With Appium In Java - Mobile Application Testing (Android & iOS)

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.

Prerequisites

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.

Test Apps:


Setup Instructions

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

Install required dependencies:

1. Install dependencies using npm:

npm install

2. Set up WebDriverAgent (iOS Only):

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.


Important Note

For iOS, ensure WebDriverAgent is properly configured for testing.


Running the Tests

Android

  1. Connect your Android device with USB debugging enabled.
  2. Add Android application to folder apps
    Example:
Automation-test-script-mobile-Application-with-Appium-in-Java/apps/ApiDemos-debug.apk
  1. Launch Appium on your second terminal
appium
  1. 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"

iOS

  1. Connect your iOS device with Developer mode enabled.
  2. Add iOS application to folder apps
      Example:
Automation-test-script-mobile-Application-with-Appium-in-Java/apps/UIKITCatalog.app
  1. Launch Appium on your second terminal
appium
  1. 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"

Repository Structure

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

Contributing

Feel free to submit pull requests for enhancements or bug fixes. Please ensure code changes are properly tested.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published