Automate Test Your Mobile App Using Appium (Python) #1

Bismillah, 😀😀

In this article, I will explain about appium. Appium itself is an open-source automation tool for testing applications, with native, hybrid, and mobile web apps.

There are several points that I will Interpret in this article,

  1. Installation Android Studio
  2. Cloning Project Apps
  3. Installation Appium
  4. Configuration Appium in the Apps, & Installing in Python

1. Installation Android Studio Project

You can download android studio apps, here. Some may ask

Why Use Android Studio?

Android Studio ini akan digunakan sebagai salah satu sarana untuk membuat aplikasi sederhana yang akan dibuat, dan kita akan memanfaatkan emulator devices yang telah disediakan.

Android Studio will be used as a means to create a simple application, and we will take advantage of the emulator devices provided.

Android Studio

2. Cloning Project Apps

Cloning this android project to your local directory, and open it in the android studio.

Run the project using emulator android device in android studio, to create a new device emulator you can look in the video below.

3. Installation Appium

Download Appium here. After that, do the installation as usual.

Main Window of Appium

Choose Start Server to run our server.

Appium Run Successfully

To create a new test scenario, we need to choose File -> New Session Window.

Session Scenario Page
Fill the Desired Capabilities

Desired Capabilities is a configuration to connect our server session to the android emulator. Then, start session.

Notes

“deviceName”: Name of our emulator, to know the name of our emulator you can type in the cmd.

“appPackage”, “appActivity”: This is the name of the package and activity of our application.

Print out our activity log emulator to logfile.txt
Result logfile.txt

Blue Line, Name of the package. Red Line, Name of the activity

Appium inspector will appear in our window

Video of Appium Inspector,

and then I’ll show you how to convert from appium inspector to python code.

When you activate the recorder, there will be several configurations. Selected Element is the information of our object inspection in this, you can send a key, tap a button, or clear the object. App Source, show the hierarchical structure of our view.

Installing Appium in Python

First of all, download Appium Client. Before run our server appium project, we have to setup our file python. Like in this example,

Run your code then, if the testing working well the message will be like this.

Happy Coding, 🍜🍜

Please, Comment if you have question about this article. Thanks, 😁😁