Skip to content

Instantly share code, notes, and snippets.

@thomi137
Created November 4, 2013 14:19
Show Gist options
  • Save thomi137/7303112 to your computer and use it in GitHub Desktop.
Save thomi137/7303112 to your computer and use it in GitHub Desktop.
CensusAppUITest. UIAutomator sample code for the Tricentis Accelerate Conference 2013
/**
* CensusAppUITest
* com.newthinktank.censusapp.test
* HomeScreenTestCase.java
* TODO
* Copyright (c) 30.10.2013, 2013 t.prosser
* Description:
*/
package com.newthinktank.censusapp.test;
import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.core.UiSelector;
import com.android.uiautomator.testrunner.UiAutomatorTestCase;
public class HomeScreenTestCase extends UiAutomatorTestCase {
public void testHomeScreen(){
// Navigate to the home screen
getUiDevice().pressHome();
// Select all Apps Button
UiObject allAppsButton = new UiObject(new UiSelector().description("Apps"));
try {
allAppsButton.clickAndWaitForNewWindow();
} catch (UiObjectNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
UiObject CensusAppSelector = new UiObject(new UiSelector().description("Census App"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment