Appium 2.0

Hello,

I'm Sai Krishna

Principal Consultant

@saikrisv

saikrishna321

I'm Srinivasan

Lead Consultant

@srinivasanskr

srinivasanTarget

I'm Srinivasan

Lead Consultant

@srinivasanskr

srinivasanTarget

Why Appium 2.0?

 

Appium Plugins

 

Demo

 

Agenda

Appium Plugin

Android Architecture

W3C

Server Request

Server

Client

Appium Server

Driver(espresso)

Server Request

Plugins

What is an Appium 2.0 Plugin

  • Update the Appium server object before it starts listening for requests

 

  • Plugins add arbitrary functionality that executes before or after the actual Appium commands.

 

  • Plugins alter the Appium server to introduce new commands and distribute it.

How to build your own plugin?

LIVE CODING

  • Create new routes

  • Override/modify existing Appium Methods

  "dependencies": {
    "@appium/base-plugin": "^1.6.4"
  },  
  "appium": {
    "pluginName": "<plugin name>",
    "mainClass": "<class name>"
  },
  
export default class AppiumPlugin extends BasePlugin {

 async createSession(next, driver, jwpDesCaps, jwpReqCaps, caps) {
   log.info('Building my new appium plugin');
   .....
   await next();
   }
}

Step 1

Step 2

static newMethodMap = {
    '/session/:sessionId/fake_data': {
      GET: {command: 'getFakeSessionData'}
    },
};


async getFakeSessionData (next, driver) {
    await B.delay(1);
    return driver.fakeSessionData || null;
}

Adding new routes

driver.getFakeData()

Server

Client

appium plugin install --source=local <path to plugin>
appium plugin install --source=npm appium-wait-plugin
appium --plugins=element-wait

Plugin Installation

Plugin Activation

Plugins

Available Plugins

Appium 2.0

By Srinivasan Sekar

Appium 2.0

  • 1,193