Raulp
Raulp

Reputation: 8136

Way to Automate button clicks of an Android Application

Is there a way to automate the clicking (opening,clicking certain button of the application and finally closing it) with some script or an android application.

Upvotes: 2

Views: 10979

Answers (2)

walljam7
walljam7

Reputation: 343

You can use uiautomator (requires API 16+).

Robotium (which also uses the Android testing framework) is another great testing framework for UI. Same goes for Espresso. You can then write JUnit 3 tests for your app.

Upvotes: 1

JHH
JHH

Reputation: 9295

Depends on what you're trying to do. For UI testing of your app you can use the build-in support, have a look at http://developer.android.com/training/activity-testing/activity-ui-testing.html or perhaps look into the UI automation tool.

If what you want to do is emulate user events on any given app, you could use adb to send key or touch events, but it would be a on a very low level

For example:

adb shell input keyevent 3

Would emulate pressing the home key.

You could also do

adb shell input tap 50 50 

to emulate a touch event at the given coordinate.

Upvotes: 9

Related Questions