Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Setting Up Appium with Python Environment

Tech 1

Dependencies

  • Node.js
  • Appium
  • Appium Inspector
  • Appium-Python-Client
  • Python
  • JDK (Java Development Kit)
  • Android SDK

JDK Installation & Configuration

Download

Get JDK from:
Oracle JDK 8 Downloads

Configuration

Follow the guide to set up environment variables:
JDK Environment Variable Setup

Verify Installation

After setup, open Command Prompt and run:

C:\Users\TestUser>java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

Android SDK Installation

Download

Get the Android SDK from:
Android SDK Download

Configuration

Set the ANDROID_HOME environment variable after installation. Reference:
Android SDK Environment Setup

Node.js Installation

Download

Download Node.js from:
Node.js Releases

Note: Ensure Node.js version compatibility with Appium.

Verify Installation

Open Command Prompt (Win+R → cmd), run:

C:\Users\TestUser>node -v
v14.17.0
C:\Users\TestUser>npm -v
6.14.13

Notes:

  • npm (Node Package Manager) manages Node.js packages (similar to Python’s pip).
  • If npm is not recognized, run Command Prompt as Administrator or check environment variables.

Appium Installation

Using Taobao NPM Mirror (cnpm)

To avoid slow installation, use Taobao’s NPM mirror:

npm install -g cnpm --registry=https://registry.npm.taobao.org

After running, you should see output like:

C:\Users\TestUser>npm install -g cnpm --registry=https://registry.npm.taobao.org
npm WARN deprecated socks@1.1.11: ... (updated warning)
C:\Users\TestUser\AppData\Roaming\npm\cnpm -> ...\cnpm\bin\cnpm
+ cnpm@6.1.0
added 800+ packages in 70.123s

Install Appium

Latest Version:

cnpm install -g appium

Specific Version (e.g., 1.7.3):

cnpm install appium@1.7.3 -g

Upon completion, output similar to this appears:

All packages installed (570 packages, 58s, speed 850kB/s, ...)
[appium@1.8.1] link ...\appium@ -> ...\appium\build\lib\main.js

Install Driver

appium driver install uiautomator2

Verify Appium Installation

Check the installation path:

C:\Users\TestUser>where appium
C:\Users\TestUser\AppData\Roaming\npm\appium
C:\Users\TestUser\AppData\Roaming\npm\appium.cmd

Start Appium Server:

C:\Users\TestUser>appium -v
1.7.3

C:\Users\TestUser>appium
[Appium] Welcome to Appium v1.7.3
[Appium] Appium REST http interface listener started on 0.0.0.0:4723

If appium is not recognized, add the installation path (e.g., C:\Users\TestUser\AppData\Roaming\npm) to the Path environment variable.

Python & Appium-Python-Client

Python Installation

Ensure Python is installed (verify with python --version):

C:\Users\TestUser>python --version
Python 3.8.5

Install Appium-Python-Client

Run:

pip install Appium-Python-Client

Verify Installation

In Python shell:

C:\Users\TestUser>python
Python 3.8.5 ...
>>> from appium import webdriver

If no errors, the client is installed.

Appium-Doctor (Environment Check)

Install to verify dependencies:

cnpm install appium-doctor -g

Run the check:

C:\Users\TestUser>appium-doctor
info AppiumDoctor ...
info AppiumDoctor ✔ Node.js binary found
info AppiumDoctor ✔ ANDROID_HOME set
info AppiumDoctor ✔ JAVA_HOME set
...
info AppiumDoctor Everything looks good!

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.