Coder Social home page Coder Social logo

appium-uiautomator2-client's Introduction

Appium Uiautomator2 Client

This client is a simple implementation written in Python for appium-uiautomator2-server, it should be easy to intergarted into other testing framework.

Installation

Before using this driver, you should build, install and run appium-uiautomator2-server at first.

  • Building appium-uiautomator2-server project using below commands

    ./gradlew clean assembleServerDebug assembleServerDebugAndroidTest

  • Installing both src and test apks to the device and execute the instrumentation tests.

    adb shell am instrument -w io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner

  • Forward tcp port 6790 to local

    adb forward tcp:6790 tcp:6790

Now it is ready to control the device, below are examples

client = AppiumClient()
# Click "test" on screen
client.click_element(client.find_element(ByText("test")))
# Find element by xpath, class name, resrouce id, and uiautpmator statements
client.find_element(ByXpath("//*[@class='android.widget.TextView'][1]"))
client.find_element(ByClass("android.widget.TextView"))
client.find_element(ById("android:id/text1"))
client.find_element(ByUiautomator("new UiSelector().resourceId(\"android:id/text1\")"))
# Tap (x, y)
client.tap(x, y)

ToDo

This client was implemented several yesrs ago, I didn't test all the fucntions on the latest version of appium uiautomator2 server. So there might be adaption works if the service side has changes.

License

MIT

Free Software, Hell Yeah!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.