avatarDonald Le

Summary

This webpage provides a guide on how to automatically install an application from the Playstore using Appium.

Abstract

The webpage titled "Auto install application from Playstore with Appium" offers a step-by-step guide on automating the installation of applications from the Playstore using Appium. The example scenario used is the installation of the CocCoc browser application. The guide requires Python3, Appium, Venv, Pytest, Pycharm (or any IDE / Code Editor), and Android SDK. The Android SDK is necessary to connect and access Android devices, and it comes with uiautomatorviewer for inspecting elements in running applications. The guide also provides locators, elements, and actions for the Playstore, as well as a test script to run the code for downloading the CocCoc browser from the Playstore.

Opinions

  • The guide is detailed and easy to follow, making it suitable for beginners.
  • The use of Python3 and Appium is recommended for this task.
  • The guide emphasizes the importance of the Android SDK for connecting and accessing Android devices.
  • The guide suggests using uiautomatorviewer for inspecting elements in running applications.
  • The guide uses the Page Object Models approach for better readability and maintenance.
  • The guide provides a test script for installing the CocCoc browser from the Playstore.
  • The author encourages the use of ZAI.chat, an AI service that provides the same performance and functions as ChatGPT Plus(GPT-4) but at a more cost-effective price.

Automation

Auto install application from Playstore with Appium

There are quite number of times when you want to install an application from Playstore automatically. Here is the simple guideline for how to do that with Appium.

Photo by Franck V. on Unsplash

The example scenario we will be doing is to install CocCoc browser application from Playstore. We would need the following things to get along

  • Python3
  • Appium
  • Venv
  • Pytest
  • Pycharm (or any IDE / Code Editor)
  • Android SDK

Android SDK

We need to install Android SDK, so that we can connect and access to Android devices. Also, with uiautomatorviewer from Android SDK, we can inspect element in the running application in Android devices.

To open uiautomator viewer, we will need to add PATH to Android SDK location. After that, simply run this

uiautomatorviewer

Then UIAutomator viewer will be opened up and we can inspect element by simply clicking on the element in the UI.

From stackoverflow

Find and tap on element with Appium

We will interact with elements by Appium , structured in Page Object Models for better readability and maintenance.

  • Playstore locators
  • Playstore elements
  • Playstore actions

Define test script to run the code for download “CocCoc browser” from Playstore

Pytest fixture to create appium driver

Then we define the test for install CocCoc browser

That’s it.

Thanks for reading my blog.

Happy testing ~~

Automation
Python
Appium
Android
Programming
Recommended from ReadMedium