Skip to content

Most visited

Recently visited



public class UiAutomatorTestCase
extends InstrumentationTestCase

   ↳ junit.framework.Assert
     ↳ junit.framework.TestCase
       ↳ android.test.InstrumentationTestCase

This class is deprecated.
It is no longer necessary to extend UiAutomatorTestCase. You can use getInstance(Instrumentation) from any test class as long as you have access to an Instrumentation instance.

UI Automator test case that is executed on the device.


Public constructors


Public methods

IAutomationSupport getAutomationSupport()

This method is deprecated. Use sendStatus(int, Bundle) instead

Bundle getParams()

Get command line parameters.

UiDevice getUiDevice()

Get current instance of UiDevice.

void sleep(long ms)

This method is deprecated. Use sleep(long) instead.

Inherited methods

From class android.test.InstrumentationTestCase
From class junit.framework.TestCase
From class junit.framework.Assert
From class java.lang.Object
From interface junit.framework.Test

Public constructors


UiAutomatorTestCase ()

Public methods


IAutomationSupport getAutomationSupport ()

This method is deprecated.
Use sendStatus(int, Bundle) instead

Provides support for running tests to report interim status

IAutomationSupport IAutomationSupport


Bundle getParams ()

Get command line parameters. On the command line when passing -e key value pairs, the Bundle will have the key value pairs conveniently available to the tests.



UiDevice getUiDevice ()

Get current instance of UiDevice. Works similar to calling the static getInstance() from anywhere in the test classes.



void sleep (long ms)

This method is deprecated.
Use sleep(long) instead.

Calls sleep(long) to sleep

ms long: is in milliseconds.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)