Created
November 4, 2013 14:19
-
-
Save thomi137/7303112 to your computer and use it in GitHub Desktop.
CensusAppUITest. UIAutomator sample code for the Tricentis Accelerate Conference 2013
This file contains 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
/** | |
* 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