Search in sources :

Example 1 with UiDevice

use of androidx.test.uiautomator.UiDevice in project android by nextcloud.

the class InitialTest method clickByText.

/**
 * Helper to click on object that match the text value.
 *
 * @param text the text
 * @throws UiObjectNotFoundException
 */
private void clickByText(String text) throws UiObjectNotFoundException {
    UiDevice device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
    UiObject obj = device.findObject(new UiSelector().text(text));
    obj.clickAndWaitForNewWindow();
}
Also used : UiObject(androidx.test.uiautomator.UiObject) UiSelector(androidx.test.uiautomator.UiSelector) UiDevice(androidx.test.uiautomator.UiDevice)

Aggregations

UiDevice (androidx.test.uiautomator.UiDevice)1 UiObject (androidx.test.uiautomator.UiObject)1 UiSelector (androidx.test.uiautomator.UiSelector)1