HOV QA Engineers
  • 🔍HOV QA Engineers
  • AGILE TESTING
    • 💻CSS elements for QA
    • 🛫On-boarding QA
    • 🤝Testers Communications, Task and Responsibilities
    • ♻️Software Testing Life cycle
    • 📓Test Plan
    • 🎟️Kanban board and ticket flows
    • 📓User Stories and Acceptance Criteria
    • 👣Gherkin syntax
    • 🤖Test Design
    • 📅Test Strategy
    • 👬Types of Testing strategy
    • 🧪Testing types
    • 🐛Bug and Bug life Cycle
    • ✍️Manual Testing
    • Automation testing
    • 👷‍♂️E2E Testing
    • E2E testing best practices
    • Accessibility testing
    • Performance testing
    • Mobile Testing
  • Tools and Guidelines
    • Software QA Engineer Roadmap
    • 💻Setup Cypress v10 E2E testing
    • 🧪Setup End to end test with Cypress test suite
    • Setup Performance test with k6
    • API testing with postman
    • Building GitHub Action part 1
    • ✍️Playwright + Cucumber
  • Training Videos
    • SQA Trainings
  • Research
    • 📱Mobile Automation with Appium
      • Setup Project and Configuration (Android)
    • 🎭Playwright - Web Apps E2E Testing Tool
      • Setup Project and Configuration (Android)
    • Testing Library
  • PROJECTS
    • Page 2
    • Opexa
    • 📣Identifi
      • ⚖️SQA Metrics and Testing progress
      • 🧪Manual testing
        • WEB
          • Sanity Testing
          • Regression Test cases
          • Credentials and URLs
        • Android
          • Sanity Testing
          • Regression Testing
          • End to end Testing
          • Credentials
        • IOS
          • Sanity Testing
          • Regression Testing
      • 📔API Testing
      • 🤖Web Automation
        • E2E Automation Test Plan
        • Web Automation Setup
          • 🚧Setup WSL2 Environment for Windows
          • 🏗️Setup local Environment (Linux/Ubuntu)
        • Regression Testing Coverage
        • Sanity Testing Coverage
      • 🎭Performance Testing
        • K6 Test Runs
      • 📴Mobile Automation
        • Mobile Automation Test Plan
        • Identifi Mobile Automation Setup
      • Page 1
    • 🖼️subsit
      • Test plan
      • Smoke Test cases
      • 🧪Test Scenarios
      • 🕸️Web Automation
    • 🧵ThreadSync
      • Test Plan
    • 👁️UpWatch
      • Product Requirement
      • Test plan
      • Monitoring & Bug Reporting
      • E2E Test
        • E2E UpWatch Test
      • E2E QA Automation
    • 🎲Wallet
      • 🧬Test Plan
      • 💻E2E Wallet Automation Test Plan
      • 📖E2E Test Automation Docs
      • 📑Credentials| Urls
      • 📚Wallet Feature List
    • 👨‍💻DevLuvs
      • 🧪Test Cases
      • 🔑Credentials For Automation
        • 🤖Automation Test Cases
      • 📊Automation Board
    • ⚙️Mehira
      • 🕸️Web Automation
      • Sanity Testing Document
      • How to start running Mehira application from your local using Docker engine via Ubuntu platform
Powered by GitBook
On this page
  • WebdriverIO config (Android)
  • Setup Emulator for Testing
  1. Research
  2. Mobile Automation with Appium

Setup Project and Configuration (Android)

  • Create & Initialize a new directory

    • mkdir <project-name>

    • cd <project-name>

    • npm init -y

  • Install WebdriverIO CLI

    • npm i @wdio/cli

  • Setup config

    • npx wdio config

      Select the ff:

      • Where is your automation backend located: On my local machine

      • Which framework do you want to use: mocha/cucumber

      • Do you want to use a compiler? : No

      • Where are your test specs located: select default

      • Do you want WebdriverIO to autogenerate some test files?: Yes

      • Which reporter do you want to user: spec

      • Do you want to add a service to your test setup?: select appium

      • What is the base url: select default

      Then it will install all the relevant packages.

      Make sure you install npm i appium@2.0.0-beta.35

WebdriverIO config (Android)

  • Walkthrough

    wdio.conf.js

    • Port: 4723 This is the port where appium server will spin off

    • specs: this is where all the spec are located

    • capabilities needs to specify all the android specification

    • log: default webdriverIO log which will generate when running the test

    • baseurl: We dont need this since we are going to run in in appium

    • services: appium server to , it is connected to appium services to spin off appium server

  • Add test up

    • create a new folder app/android add the app on that folder

  • Update capabilities

    • Platform name

    • Device name

    • App path

    config.capabilities = [
      {
        platformName: 'Android',
        'appium:platformVersion': "12",
        'appium:deviceName': 'Pixel 5',
        'appium:automationName': 'UIAutomator2',
        'appium:app': path.join(process.cwd(), 'app/android/app-dev-release.apk'),
        'appium:autoGrantPermissions': true
      }
    ]

  • Setup Test folder

    • Create test/specs folder and sample.js file and paste the code below

    describe('Sample', () => {
      it('Sample Test', async () => {
        await driver.pause(3000);
      });
    })

  • Run app with WebdriverIO npx wdio

    if you got an error: Unable to connect to the server:

    • Make sure you install appium on your project npm i appium@2.0.0-beta.35

    • Check if appium driver are installed : npx appium driver list

      Make sure uiautomator2 and xcuitest are installed

      • uiautomator2 - npx appium driver install uiautomator2

      • xcuitest - appium driver install xcuitest

Setup Emulator for Testing

  • Add emulator in Android Studio

    • Create another Virtual with different android version

  • Add capabilities in Appium Inspector

    • Remote Port: 4724

    • Remote Host: 127.0.0.1

    • Remote path: /

    • Desired Capabilities

      • PlatformName: Android

      • platformVersion: 11

      • deviceName: Nexus_S

      • app: <application path>

      • automationName: UIAutomator2

    • Check Automatically add necessary Appium vendor prefixes on Start

    • run port: appium -p 4724 on your terminal

    • Start Session to run the Appium Inspector

PreviousMobile Automation with AppiumNextPlaywright - Web Apps E2E Testing Tool

Last updated 2 years ago

📱