Back to Courses
APPIUM WITH JAVA — ANDROID · iOS · TESTNG · PAGE OBJECT MODEL · JENKINS

Mobile Test Automation with Appium —
From Real Devices to CI/CD Pipelines

Master Appium architecture, UiAutomator2, DesiredCapabilities, TestNG, Extent Reports, Maven, POM, and Jenkins — a complete Java-based mobile automation course built for real job readiness.

25+
Days of Training
12
Modules
80+
Topics Covered
Android+iOS
Platforms

Who Is This Course For?

Built for Java automation engineers who can already automate web browsers using Selenium and want to extend that skill into mobile testing — automating Android and iOS apps on real devices and emulators using Appium.

Java (OOP) Selenium WebDriver Android/iOS Device or Emulator TestNG Maven

Revision Classes — Java Advanced & Selenium Basics

The opening sessions of each batch cover hands-on revision of Java OOP (encapsulation, inheritance, polymorphism, abstraction), Java Collections (List, ArrayList, Stack, Map, HashMap), GitHub, and Selenium WebDriver fundamentals. The scope and pace of revision is calibrated per batch and these topics are not counted as standalone course modules.

Your Learning Journey

Appium Architecture & Setup
App Types & Environment
Locators & Inspector
Capabilities & Launch
Element Actions
App Reset & Special Caps
TestNG & Assertions
Extent Reports
Maven & Framework
Jenkins CI/CD & POM
MODULE 01
Appium Architecture & Environment Setup
Node.js · Appium Server · UiAutomator2 · appium-doctor · Appium Inspector
WHY THIS MODULE

Before you can automate a single tap, you need to understand how Appium actually controls a phone. Appium sits between your Java test code and the device — just like a translator. Getting the installation right and verifying it with appium-doctor saves hours of debugging later. This module is your foundation for everything that follows.

Appium Architecture
  • Appium server-client architecture — how your code talks to the phone
  • How Appium extends the Selenium WebDriver protocol to mobile
  • Appium vs Selenium — what's the same, what's different
  • JSON Wire Protocol / W3C WebDriver protocol
  • UiAutomator2 driver for Android automation
  • XCUITest driver for iOS automation
Environment Installation
  • Install Node.js and npm — Appium runs on Node
  • Install Appium globally: npm install -g appium
  • Install appium-uiautomator2-driver for Android
  • Set ANDROID_HOME and configure PATH for SDK tools
  • Verify full setup: run appium-doctor — fix all warnings
Appium Inspector
  • Launch Appium Inspector and connect to localhost:4723
  • Inspect live elements on a running Android app
  • Read resource-id, content-desc, and class attributes
MODULE 02
App Types & Mobile Environment
Native · Hybrid · Web · AVD · adb devices · iOS Simulator
WHY THIS MODULE

Not all mobile apps behave the same way. A native banking app, a hybrid shopping app with an embedded website, and a mobile web page each need a slightly different testing approach. Knowing the difference early prevents you from writing tests that only work for one type. Setting up real devices and emulators gives you a reliable test environment before any actual test code is written.

Types of Mobile Applications
  • Native apps — platform-specific APK or IPA, fastest performance
  • Hybrid apps — native shell wrapping a WebView
  • Mobile web apps — browser-based, no install required
  • How Appium handles each type differently
Android Environment
  • Create and launch Android Virtual Device (AVD emulator)
  • Enable USB debugging on a real Android phone
  • Confirm the device is visible: adb devices
  • Install APK on device: adb install app.apk
  • Get appPackage and appActivity with adb shell
iOS Environment (Mac Setup)
  • Xcode installation and iOS Simulator setup
  • Install appium-xcuitest-driver for iOS
  • UDID — unique identifier for real iPhone
  • bundleId — equivalent of appPackage for iOS apps
MODULE 03
Locators & Appium Inspector
resource-id · xpath · accessibility id · AndroidUIAutomator · appPackage · appActivity
WHY THIS MODULE

Every test action — tap, type, verify — depends on finding the right element. Mobile locators are different from web locators. Unlike a browser, you can't just right-click and inspect. This module teaches you how to use Appium Inspector to visually browse any app's element tree and pick the most reliable locator before you write a single line of code — saving huge amounts of debugging time.

Mobile Locator Strategies
  • By.id() — using resource-id (most stable)
  • By.xpath() — relative and absolute path expressions
  • AppiumBy.accessibilityId() — using content-desc
  • AppiumBy.androidUIAutomator() with UiSelector text queries
  • By.className() — widget class name fallback
  • Locator reliability vs performance trade-offs
App Package & App Activity
  • appPackage — the app's unique ID (e.g. com.android.calculator2)
  • appActivity — the screen Appium launches first
  • Find both using adb shell dumpsys window
  • Verify locators in the Inspector before writing code
MODULE 04
Capabilities & DesiredCapabilities
UiAutomator2Options · platformName · deviceName · appPackage · app · activateApp
WHY THIS MODULE

Capabilities are how you tell Appium everything it needs to know before a test starts — which device, which app, which OS. Getting them right means your driver launches cleanly every time. This module also bridges Appium 1.x (legacy DesiredCapabilities) and Appium 2.x (typed options classes) so you can work confidently in any project, old or new.

Capability Classes
  • DesiredCapabilities — legacy key-value approach (Appium 1.x)
  • UiAutomator2Options — typed, IDE-friendly class (Appium 2.x)
  • Creating AndroidDriver using options + server URL
  • Appium server URL: new URL("http://127.0.0.1:4723")
Core Capabilities
  • platformName"Android" or "iOS"
  • deviceName — AVD name or physical device label
  • automationName"UiAutomator2" or "XCUITest"
  • appPackage + appActivity for installed apps
  • app — path to APK/IPA for install-on-launch
  • driver.activateApp() / terminateApp() — switch apps mid-test
MODULE 05
Element Actions & Gestures
click · sendKeys · findElements · swipe · scroll · PointerInput · hideKeyboard
WHY THIS MODULE

This is where your test code actually does something. Tapping a button, typing a search term, swiping through a carousel, scrolling to a product — these are the core interactions every mobile test needs. Understanding gestures using the W3C Actions API is especially important because the older TouchAction class is now deprecated, and many teams still use it incorrectly.

Basic Element Interactions
  • element.click() — tap a button or link
  • element.sendKeys("text") — type into an input field
  • element.getText() — read the visible text
  • isDisplayed(), isEnabled(), isSelected()
  • element.clear() — empty an input field
findElements & List Handling
  • driver.findElements() — returns a List<WebElement>
  • Count items: list.size()
  • Access by index: list.get(n)
  • Loop through all list items with a for loop
Gestures — W3C Actions API
  • PointerInput + Sequence — modern swipe and drag
  • Swipe up/down/left/right using screen coordinates
  • Scroll to element with UiScrollable (Android)
  • Long press with touch duration
  • Pinch and zoom gestures
  • driver.hideKeyboard() — dismiss soft keyboard
MODULE 06
App Reset & Special Capabilities
noReset · fullReset · autoGrantPermissions · context switching · WEBVIEW
WHY THIS MODULE

How the app starts at the beginning of each test is critical. A test that relies on a logged-in state will fail if the app is reinstalled every time. A test that needs a clean state will give false passes if it reuses stale data. Understanding noReset vs fullReset — and all the special capabilities that control permissions, keyboards, and context — separates a working test suite from a flaky one.

Reset Capabilities
  • noReset: true — preserve login and data between sessions
  • fullReset: true — uninstall and reinstall for a clean slate
  • Default reset — clears app data, keeps app installed
  • Choosing the right reset per test scenario
Additional Capabilities & Context
  • autoGrantPermissions: true — skip all permission pop-ups
  • newCommandTimeout — prevent session timeout in slow tests
  • unicodeKeyboard / resetKeyboard for special characters
  • driver.getContextHandles() — list available contexts
  • Switch to WebView: driver.context("WEBVIEW_*")
  • Switch back to native: driver.context("NATIVE_APP")
MODULE 07
TestNG Framework Integration
@BeforeMethod · @AfterMethod · @Test · testng.xml · @DataProvider · parallel
WHY THIS MODULE

Raw test methods running in random order without setup and teardown is not a framework — it's a script. TestNG gives your mobile tests structure: drivers launch reliably before each test and close cleanly afterwards, test groups let you run smoke tests in 5 minutes or full regression overnight, and data providers let one test cover 20 scenarios automatically. This is how professional teams manage hundreds of tests.

TestNG Annotations
  • @BeforeMethod — launch AndroidDriver before each test
  • @AfterMethod — quit driver cleanly after each test
  • @BeforeClass / @AfterClass — class-level lifecycle
  • @Test(priority=) — control execution order
  • @Test(groups={"smoke","regression"}) — group-based runs
Test Execution & Configuration
  • testng.xml — suite file defining which tests run
  • parallel="methods" — run tests simultaneously
  • @DataProvider — feed multiple data sets to one test
  • @Parameters — pass device name from XML config
  • ITestListener — hook into pass/fail events
MODULE 08
Assertions — Hard & Soft
Assert.assertEquals · Assert.assertTrue · SoftAssert · assertAll
WHY THIS MODULE

A test that doesn't verify anything is just a script that taps buttons. Assertions are what make a test actually useful — they are the checks that tell you whether the app is working correctly. Knowing when to use a hard assertion (stop at the first failure) versus a soft assertion (collect all failures at once) has a direct impact on how useful your test results are to developers fixing bugs.

Hard Assertions
  • Assert.assertEquals(actual, expected) — text/value match
  • Assert.assertTrue(condition) / assertFalse()
  • Assert.assertNotNull(object) — element exists
  • Test stops immediately on assertion failure
Soft Assertions
  • SoftAssert sa = new SoftAssert() — one per test method
  • sa.assertEquals(), sa.assertTrue() — continue on failure
  • sa.assertAll() — report all failures at the end
  • When to use soft assertions: validating a full screen with multiple fields
MODULE 09
Test Reporting — TestNG & Extent Reports
ExtentReports · ExtentTest · ITestListener · TakesScreenshot · MediaEntityBuilder
WHY THIS MODULE

When a test fails at 2 AM in a CI/CD pipeline, the report is the only way the team knows what went wrong. A plain TestNG HTML report shows pass/fail numbers. An Extent Report shows pass/fail, the steps that led to the failure, and a screenshot of the exact moment the test broke. That difference is what makes your test results actually actionable for developers — and what makes you stand out in interviews.

TestNG Built-in Reports
  • Default HTML report auto-generated in test-output/
  • emailable-report.html — shareable summary
  • Pass/fail/skip breakdown with stack traces
Extent Reports Integration
  • Add extentreports Maven dependency
  • ExtentReports — defines report output path
  • ExtentTest — log steps for each test
  • extentTest.pass() / .fail() / .skip()
  • Capture screenshot on failure: TakesScreenshot interface
  • Embed screenshot in report: MediaEntityBuilder
  • Auto-report via ITestListener — no boilerplate in each test
  • Finalise report: extent.flush()
MODULE 10
Maven & Framework Setup
pom.xml · maven-surefire-plugin · mvn test · Apache POI · XSSFWorkbook
WHY THIS MODULE

A project that only runs from inside an IDE is not production-ready. Maven turns your test project into something that can be triggered from a terminal, a CI server, or a scheduled job — anywhere, without opening Eclipse. Data-driven testing with Excel takes it further: instead of writing 20 identical tests for 20 usernames, you write one test and read all 20 usernames from a spreadsheet. This is how real teams work.

Maven Project Configuration
  • Maven project structure: src/main/java, src/test/java
  • pom.xml — add Appium, TestNG, Extent Reports, Apache POI
  • maven-surefire-plugin — link testng.xml for execution
  • Run all tests from terminal: mvn test
  • Run specific groups: mvn test -Dgroups=smoke
Data-Driven Testing with Excel
  • Apache POI dependency: poi-ooxml
  • Read Excel: XSSFWorkbookXSSFSheetRowCell
  • Build ExcelUtils helper class
  • Feed Excel data into @DataProvider for parameterised tests
MODULE 11
Page Object Model (POM)
PageFactory · @FindBy · @AndroidFindBy · ThreadLocal driver · DriverManager
WHY THIS MODULE

As soon as an app has more than 10 screens and 50 tests, hard-coded locators in test classes become a maintenance disaster. Page Object Model is the industry-standard pattern that every employer expects. One locator per file. One change fixes everything. Tests read like plain English. This module is where your project transforms from a collection of scripts into a professional, maintainable automation framework.

POM Design Pattern
  • One page class per screen — encapsulates locators and actions
  • Test classes only call page methods — no locators in tests
  • One locator change fixes all tests that use that screen
  • Tests read like plain English: loginPage.enterUsername("admin")
PageFactory with Appium
  • @FindBy(id = "resource-id") field annotation
  • @AndroidFindBy / @iOSXCUITFindBy platform-specific annotations
  • PageFactory.initElements(driver, this) in page constructor
  • Lazy loading — elements located only on first interaction
Framework Architecture
  • Project layers: pages/, tests/, utils/, config/
  • config.properties — externalise device name, app package
  • DriverManager with ThreadLocal<AndroidDriver> for parallel safety
MODULE 12
Jenkins CI/CD, Retry Mechanism & iOS on Mac
Jenkins pipeline · IRetryAnalyzer · IAnnotationTransformer · XCUITest · Simulator
WHY THIS MODULE

A test suite that only runs when a tester opens their laptop is not delivering its full value. Jenkins makes tests run automatically — after every code commit, every night, or on any schedule — and notifies the team immediately if something breaks. The retry mechanism handles the real-world reality of flaky network connections and device hiccups. iOS support rounds out your skill set so you can test on both platforms that matter.

Jenkins CI/CD Integration
  • Install Jenkins: java -jar jenkins.war
  • Create Freestyle Job — configure Git SCM + build trigger
  • Build step: mvn test — run suite from Jenkins
  • Post-build: publish TestNG results and HTML reports
  • Parameterised builds — pass deviceName as a Jenkins variable
  • Schedule nightly test runs with cron expression
Retry Mechanism
  • Implement IRetryAnalyzer interface
  • retry() — return true to re-run the failed test
  • Set max retry count (e.g. 2 retries before final failure)
  • Apply globally via IAnnotationTransformer — no per-test code changes
iOS Automation on Mac
  • Set platformName: "iOS", automationName: "XCUITest"
  • Connect real iPhone — trust device, provide UDID
  • bundleId capability for installed iOS app
  • Run on iOS Simulator using Xcode SimCtl
Interview Prep — Top Questions
What is the difference between noReset and fullReset?
noReset:true keeps the app state (stays logged in). fullReset:true uninstalls and reinstalls — giving you a completely clean app. Default reset only clears data without uninstalling.
How does Appium differ from Selenium?
Appium extends the WebDriver protocol to work with native mobile apps — using UiAutomator2 for Android and XCUITest for iOS. Selenium only works with web browsers. Same API, different target.
What is SoftAssert and when should you use it?
SoftAssert continues running the test even when a check fails, then reports everything at once via assertAll(). Use it when you want to verify multiple fields on a screen in one test run.
What is appPackage and appActivity?
appPackage is the app's unique ID (e.g. com.android.calculator2). appActivity is the entry screen Appium launches. Both are required to open an already-installed app without providing the APK.
What is Page Object Model?
POM stores each screen's locators and actions in a dedicated class using @FindBy and PageFactory. Test classes call page methods instead of using locators directly — making the framework easy to maintain.
How do you handle context switching in hybrid apps?
Use driver.getContextHandles() to list all contexts, switch to "WEBVIEW_*" to interact with embedded web content, then switch back to "NATIVE_APP" for native elements.