Giter Club home page Giter Club logo

appcrawler-1's Introduction

AppCrawler

Android App UI Crawler using UiAutomator

AppCrawler is an automatic UI testing tool based on android UIAutomator. It tries to traverse through the app, analyzes each screen, take screenshot and perform test on testable UI components. This is handy in case of smoke test and compatibility testing across different devices. It is also a convenient screenshot tool for GUI review, marketing reference, etc.

Features

  • Easy to use as monkey, No need of writing test script and source code of target app.
  • Able to detect ANR/Crash with human reproducible steps log (compare with monkey).
  • Screen-based CPU/Memory performance log.
  • Can handle common system/3rd-party popups.
  • Configuration options, such as setting the number of events to attempt.

Limitations

  • Requires Android 4.3 (API level 18) or higher device due to UIAutomator.
  • Can not test App with no launchable Activity, for example IME.
  • Depends on target app characteristic, UI coverage might be low.

How to use AppCrawler

Installation

$ adb install -r AppCrawlerUtil.apk
$ adb install -r AppCrawlerTest.apk

Execution

$ adb shell am instrument -e target <package> -w com.eaway.appcrawler.test/android.support.test.runner.AndroidJUnitRunner

Output

The generated screenshots and logs are saved on device.

/sdcard/AppCrawler/<package>/

Command Options Reference

Option Description
-e target [package] Target package to be tested
-e max-steps [number] Maximum test steps (e.g. click, scroll), default 999
-e max-depth [number] Maximum depth from the root activity (default launchable activity), default 30
-e max-screenshot [number] Maximum screenshot file, default 999
-e max-screenloop [number] Maximum screens loop to avoid being infinite loop, default 20
-e max-runtime [second] Maximum run time in second, default 3600
-e capture-steps [true|false] Take screenshot for every steps, this will generate more screenshots (may be duplicate), default false.
-e random-text [true|false] Input some random text to EditText if any, default true.
-e launch-timeout [millisecond] timeout millisecond for launching app package, default 5000
-e waitidle-timeout [millisecond] timeout millisecond for wait app idle, default 100

FAQ

How AppCrawler works?

  • Basically, it use Depth-First-Search (DFS) algorithm to inspect screen's view hierarchy, find testable Views on screen (Clickable, Scrollable, EditText, ...), performance test in turn, and check screen changes repeatedly.

How it compare with android Monkey?

  • Monkey test is based on random strategy, may not able to go every screen in a short time, can spend too much time on trivial screens.
  • Monkey test generates too many events, it is hard to replay test steps by human for bug reproduction.

Next Actions

  • Support more user input events: long-click, scroll, gesture, etc.
  • Support more system events: Screen orientation, Language, Wireless, Power/Volume keys, etc.
  • Heuristic algorithm to enhance UI coverage.
  • Extensibility: Logon support.

Reference

A GUI Crawling-based technique for Android Mobile Application Testing http://www.cs.umd.edu/~atif/testbeds/TESTBEDS2011-papers/Amalfitano.pdf

Guided GUI Testing of Android Apps with Minimal Restart and Approximate Learning http://www.cs.berkeley.edu/~necula/Papers/swifthand-oopsla13.pdf

SuperMonkey https://github.com/testobject/supermonkey

Release

Author

Eaway Lu <[email protected]>

appcrawler-1's People

Contributors

eaway avatar

Watchers

 avatar  avatar

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.