Skip to content

APPIUM SETUP FOR JAVASCRIPT

navin9584 edited this page May 31, 2022 · 2 revisions

Installation

NODE

Install Node v16

not the latest version Node v17 as that is not compatible as of now with WebdriverIO & Appium.


JAVA

Install Java and set environmental path (JAVA_HOME) in system


ANDROID STUDIO

Download Android Studio and set sdk environmental path (Android_Home) in system

Android Studio


> ANDROID EMULATOR

The Android Emulator simulates Android devices on your computer so that you can test your application on a variety of devices and Android API levels without needing to have each physical device. Android emulator


> APPIUM INSPECTOR setup

Appium Inspector icon

A GUI inspector for mobile apps and more, powered by a (separately installed) Appium server.its desired capabilities.

Appium Inspector screenshot

A GUI inspector for mobile apps and more, powered by a (separately installed) Appium server. When you're using it to inspect a mobile app, it looks like this:

Appium Inspector screenshot

Appium Inspector is basically just an Appium client (like WebdriverIO, Appium's Java client, Appium's Python client, etc...) with a user interface. There's an interface for specifying which Appium server to use, which capabilities to set, and then interacting with elements and other Appium commands once you've started a session.


> APPIUM SETUP

install version 2.0 and above run command

npm install -g appium@next

Now to verify if its dependencies installed, you can run => npm install -g appium-doctor & appium-doctor

> APPIUM DRIVER

appium driver install uiautomator2

Now to verify if its been installed, you can run => appium driver list

after setup you can start the appium server and start inspect element of the app

simply run this command => appium -p 4724

Appium Inspector screenshot

Appium Inspector screenshot


> WebdriverIO Setup

What is Webdriver.IO?

webdriverIO

what is mocha ?

mocha

go to project directory and run commands

  1. initialize directory command --> npm init

    after run this command he is asking for some info like you can follow this doc

package name (make it default by press enter key)

version (make it default by press enter key)

description (what ever you want to give)

entry point (make it default index.js by press enter)

test command (make it default by press enter key)

git repository (give repository link if any there)

keyword (you can give webdriverIO, appium)

author (you can give your name)

licence (make it default by press enter key)

Appium Inspector screenshot

  1. install webdriverIO CLI

    command -->npm install @wdio/cli

  2. setup config command --> npx wdio config

    after run this command he is asking for some info like you can follow this doc

? Where is your automation backend located? On my local machine

? Which framework do you want to use? mocha

? Do you want to use a compiler? No!

? Where are your test specs located? ./test/specs//*.js**

? Do you want WebdriverIO to autogenerate some test files? No

? Which reporter do you want to use? spec

? Do you want to add a plugin to your test setup?

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

? What is the base url? http://localhost

? Do you want me to run npm install (Y/n) y

update wdio.conf.js file

you can follow this wdio.conf.js link

now setup is completed


go to terminal and run command

npx wdio

By this command app is installed on your device and it will run the test

if getting version issue update by below command

npm i [email protected] && npm i @wdio/[email protected]

Clone this wiki locally