VOOZH about

URL: https://deepwiki.com/Accenture/Ocaramba/4.3-mobile-testing-with-appium

⇱ Mobile Testing with Appium | Accenture/Ocaramba | DeepWiki


Loading...
Last indexed: 6 June 2026 (fb3580)
Menu

Mobile Testing with Appium

The Ocaramba.Tests.Appium project provides the implementation and configuration required for automated mobile testing using the Appium framework. It specifically demonstrates Android automation using the UiAutomator2 driver, handling native app interactions, complex gestures like scrolling via AndroidUIAutomator, and context switching for Hybrid applications (WebView).

Solution Structure and Dependencies

The Appium test project is built on top of OcarambaLite and utilizes the Page Object Model (POM) defined in Ocaramba.Tests.PageObjects.

Project Configuration

The project targets net8.0 Ocaramba.Tests.Appium/Ocaramba.Tests.Appium.csproj4 and includes essential mobile automation libraries:

Mobile Test Data Flow

The following diagram illustrates how Ocaramba initializes the mobile driver and interacts with the Appium server to control an Android device or emulator.

Mobile Driver Initialization Flow


Sources: Ocaramba.Tests.Appium/UnitTest1.cs11-12 Ocaramba.Tests.Appium/AppiumSamplePage.cs13 Ocaramba.Tests.Appium/Ocaramba.Tests.Appium.csproj12 Ocaramba.Tests.Appium/appsettings.json34-37

Implementation Details

Page Objects: AppiumSamplePage

The AppiumSamplePage class demonstrates how to define mobile-specific locators using AccessibilityId and standard Selenium By selectors.

Test Logic and Context Switching

The AppiumAndroidTests class contains logic for navigating native Android menus and switching to WebView contexts.

Code Entity Mapping

This diagram maps the natural language actions to specific code entities and locator types within the Appium project.

Mobile Action to Code Mapping


Sources: Ocaramba.Tests.Appium/AppiumSamplePage.cs15-16 Ocaramba.Tests.Appium/UnitTest1.cs20-21 Ocaramba.Tests.Appium/UnitTest1.cs37 Ocaramba.Tests.Appium/UnitTest1.cs11 OcarambaLite/Locator.cs71-72

Environment Setup and CI/CD

Android Emulator Pipeline

Ocaramba uses GitHub Actions to run mobile tests. The pipeline handles the setup of the Android environment and the Appium server.

Locator Translation

The LocatorExtensions.ToBy() method bridges Ocaramba's ElementLocator to Appium's MobileBy types.

Locator EnumTranslated ToUsage Scenario
AccessibilityIdMobileBy.AccessibilityIdcontent-desc on Android OcarambaLite/Extensions/LocatorExtensions.cs72-74
AndroidUIAutomatorMobileBy.AndroidUIAutomatorComplex selectors like UiSelector().text("Login") OcarambaLite/Extensions/LocatorExtensions.cs75-77
IOSNsPredicateMobileBy.IosNSPredicateiOS specific filtering OcarambaLite/Extensions/LocatorExtensions.cs78-80
AppiumIdMobileBy.IdNative element IDs OcarambaLite/Extensions/LocatorExtensions.cs84-85
AppiumClassNameMobileBy.ClassNameMobile class name selectors OcarambaLite/Extensions/LocatorExtensions.cs86-87

Sources: Ocaramba.Tests.Appium/Ocaramba.Tests.Appium.csproj1-54 Ocaramba.Tests.Appium/AppiumSamplePage.cs1-65 Ocaramba.Tests.Appium/UnitTest1.cs1-47 OcarambaLite/Extensions/LocatorExtensions.cs72-96 Ocaramba.Tests.Appium/setup_chromedriver.sh1-16 OcarambaLite/Locator.cs71-78