Last active
October 29, 2018 10:27
-
-
Save phellipealexandre/aad201aa6db4f6568941df7b52b1d1bd to your computer and use it in GitHub Desktop.
Snippet of UI Automator Android test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Busca objeto que representa o device e vai para Home do smartphone | |
mDevice = UiDevice.getInstance(getInstrumentation()); | |
mDevice.pressHome(); | |
// Busca um componente clicável através do seu content description. | |
// Nesse caso o botão que aciona o launcher do smartphone. | |
UiObject allAppsButton = mDevice.findObject(new UiSelector().description("Apps")); | |
// Executa um click no botão anterior para carregar o launcher. | |
allAppsButton.clickAndWaitForNewWindow(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment