public class RCSolo
extends com.robotium.solo.Solo
Solo
, there is a protected field Solo.activityUtils
,
which provides the API getAllOpenedActivities(), so RCSolo
is created as subclass of Solo
.
But ActivityUtils
is only visible within package com.robotium.solo
(com.jayway.android.robotium.solo
is the old package name before Robotium 5.0.1), so the
class RCSolo
is put in the same package.Solo.checker
Solo.asserter
Solo.clicker
Solo.dialogUtils
Solo.getter
Solo.presser
Solo.screenshotTaker
Solo.scroller
Solo.searcher
Solo.sender
Solo.setter
Solo.sleeper
Solo.textEnterer
Solo.viewFetcher
Solo.waiter
Solo.webUrl
Solo.webUtils
com.robotium.solo
(com.jayway.android.robotium.solo
the old package name before Robotium 5.0.1).activityUtils, asserter, checker, clicker, CLOSED, DELETE, dialogUtils, DOWN, ENTER, getter, instrumentation, LANDSCAPE, LEFT, MENU, OPENED, PORTRAIT, presser, RIGHT, rotator, screenshotTaker, scroller, searcher, sender, setter, sleeper, swiper, systemUtils, tapper, textEnterer, UP, viewFetcher, waiter, webUrl, webUtils, zoomer
Constructor and Description |
---|
RCSolo(android.app.Instrumentation instrumentation) |
RCSolo(android.app.Instrumentation instrumentation,
android.app.Activity activity) |
Modifier and Type | Method and Description |
---|---|
void |
finishInactiveActivities()
Deprecated.
|
java.util.List<android.app.Activity> |
getAllOpenedActivities()
This method is removed from
Solo from Robotium4.1 release.Expose it in RCSolo to keep the backward compatibility. |
android.view.View |
getWaitedView()
Get the latest view that has been waited for.
|
boolean |
waitForView(int id,
int minimumNumberOfMatches,
int timeout,
boolean scroll)
Just copy the same method in super class and save the waited view to a local field.
Waits for a View matching the specified resource id. |
boolean |
waitForView(java.lang.Object tag,
int minimumNumberOfMatches,
int timeout,
boolean scroll)
Just copy the same method in super class and save the waited view to a local field.
Waits for a View matching the specified tag. |
assertCurrentActivity, assertCurrentActivity, assertCurrentActivity, assertCurrentActivity, assertMemoryNotLow, clearEditText, clearEditText, clearLog, clearTextInWebElement, clickInList, clickInList, clickLongInList, clickLongInList, clickLongInList, clickLongOnScreen, clickLongOnScreen, clickLongOnText, clickLongOnText, clickLongOnText, clickLongOnText, clickLongOnTextAndPress, clickLongOnView, clickLongOnView, clickOnActionBarHomeButton, clickOnActionBarItem, clickOnButton, clickOnButton, clickOnCheckBox, clickOnEditText, clickOnImage, clickOnImageButton, clickOnMenuItem, clickOnMenuItem, clickOnRadioButton, clickOnScreen, clickOnScreen, clickOnText, clickOnText, clickOnText, clickOnToggleButton, clickOnView, clickOnView, clickOnWebElement, clickOnWebElement, clickOnWebElement, clickOnWebElement, drag, enterText, enterText, enterTextInWebElement, finalize, finishOpenedActivities, getActivityMonitor, getButton, getButton, getButton, getConfig, getCurrentActivity, getCurrentViews, getCurrentViews, getCurrentViews, getCurrentViews, getCurrentViews, getCurrentWebElements, getCurrentWebElements, getEditText, getEditText, getEditText, getImage, getImageButton, getString, getString, getText, getText, getText, getTopParent, getView, getView, getView, getView, getView, getView, getView, getViews, getViews, getWebElement, getWebElements, getWebElements, getWebUrl, goBack, goBackToActivity, hideSoftKeyboard, isCheckBoxChecked, isCheckBoxChecked, isRadioButtonChecked, isRadioButtonChecked, isSpinnerTextSelected, isSpinnerTextSelected, isTextChecked, isToggleButtonChecked, isToggleButtonChecked, pinchToZoom, pressMenuItem, pressMenuItem, pressSoftKeyboardNextButton, pressSoftKeyboardSearchButton, pressSpinnerItem, rotateLarge, rotateSmall, scrollDown, scrollDownList, scrollDownList, scrollListToBottom, scrollListToBottom, scrollListToLine, scrollListToLine, scrollListToTop, scrollListToTop, scrollToBottom, scrollToSide, scrollToSide, scrollToSide, scrollToTop, scrollUp, scrollUpList, scrollUpList, scrollViewToSide, scrollViewToSide, scrollViewToSide, searchButton, searchButton, searchButton, searchButton, searchEditText, searchText, searchText, searchText, searchText, searchText, searchToggleButton, searchToggleButton, sendKey, setActivityOrientation, setDatePicker, setDatePicker, setMobileData, setNavigationDrawer, setProgressBar, setProgressBar, setSlidingDrawer, setSlidingDrawer, setTimePicker, setTimePicker, setWiFiData, sleep, startScreenshotSequence, startScreenshotSequence, stopScreenshotSequence, swipe, takeScreenshot, takeScreenshot, takeScreenshot, typeText, typeText, typeTextInWebElement, typeTextInWebElement, typeTextInWebElement, unlockScreen, waitForActivity, waitForActivity, waitForActivity, waitForActivity, waitForCondition, waitForDialogToClose, waitForDialogToClose, waitForDialogToOpen, waitForDialogToOpen, waitForEmptyActivityStack, waitForFragmentById, waitForFragmentById, waitForFragmentByTag, waitForFragmentByTag, waitForLogMessage, waitForLogMessage, waitForText, waitForText, waitForText, waitForText, waitForView, waitForView, waitForView, waitForView, waitForView, waitForView, waitForView, waitForView, waitForView, waitForWebElement, waitForWebElement, waitForWebElement
public RCSolo(android.app.Instrumentation instrumentation)
public RCSolo(android.app.Instrumentation instrumentation, android.app.Activity activity)
public java.util.List<android.app.Activity> getAllOpenedActivities()
Solo
from Robotium4.1 release.RCSolo
to keep the backward compatibility.public void finishInactiveActivities()
Solo
from Robotium4.1 release.The Activity handling has changed since that method was introduced. Only weak references of Activities are now stored and Activities are now also removed as soon as new ones are opened. Due to these changes finishInactiveActivities has lost its purpose. The old implementation introduced crashes as keeping references to Activities resulted in memory not being freed.
Expose it in RCSolo
as a do-nothing to keep the backward compatibility.
public android.view.View getWaitedView()
As this field waitedView
is set in the method waitForView(int, int, int, boolean)
or waitForView(Object, int, int, boolean)
,
so before we can get the View by this method, we need to call firstly waitForView(Object, int, int, boolean)
, waitForView(int, int, int, boolean)
or
the methods waitForView() who call them. To avoid the thread-influence, we should call these 2 methods in a synchronized block. Such as following:
boolean found = false;
View view = null;
synchronized(solo){
found = solo.waitForView(tag);
if(found) view = solo.getWaitedView();
}
Solo.waitForView(int)
,
Solo.waitForView(int, int, int)
,
waitForView(int, int, int, boolean)
,
Solo.waitForView(Object)
,
Solo.waitForView(Object, int, int)
,
waitForView(Object, int, int, boolean)
public boolean waitForView(java.lang.Object tag, int minimumNumberOfMatches, int timeout, boolean scroll)
waitForView
in class com.robotium.solo.Solo
tag
- the tag
of the View
to wait forminimumNumberOfMatches
- the minimum number of matches that are expected to be found. 0
means any number of matchestimeout
- the amount of time in milliseconds to waitscroll
- true
if scrolling should be performedtrue
if the View
is displayed and false
if it is not displayed before the timeoutpublic boolean waitForView(int id, int minimumNumberOfMatches, int timeout, boolean scroll)
waitForView
in class com.robotium.solo.Solo
id
- the R.id of the View
to wait forminimumNumberOfMatches
- the minimum number of matches that are expected to be found. 0
means any number of matchestimeout
- the amount of time in milliseconds to waitscroll
- true
if scrolling should be performedtrue
if the View
is displayed and false
if it is not displayed before the timeoutCopyright © SAS Institute. All Rights Reserved.