Allows you to set key parameters for running uiautomator tests. The new
settings take effect immediately and can be changed any time during a test run.
To modify parameters using Configurator
, first
obtain an instance by calling getInstance()
.
As a best practice, make sure you always save the original value of any
parameter that you are modifying. After running your tests with the modified
parameters, make sure to also restore the original parameter values, otherwise
this will impact other tests cases.
Summary
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Public Methods
public
long
getActionAcknowledgmentTimeout
()
Gets the current timeout for waiting for an acknowledgment of generic
uiautomator actions, such as clicks, text setting, and menu presses.
The acknowledgment is an AccessibilityEvent,
corresponding to an action, that lets the framework determine if the
action was successful. Generally, this timeout should not be modified.
See UiObject
Returns
- current timeout in milliseconds
public
static
Configurator
getInstance
()
Retrieves a singleton instance of Configurator.
public
long
getKeyInjectionDelay
()
Gets the current delay between key presses when injecting text input.
See setText(String)
Returns
- current delay in milliseconds
public
long
getScrollAcknowledgmentTimeout
()
Gets the timeout for waiting for an acknowledgement of an
uiautomtor scroll swipe action.
The acknowledgment is an AccessibilityEvent,
corresponding to the scroll action, that lets the framework determine if
the scroll action was successful. Generally, this timeout should not be modified.
See UiScrollable
Returns
- current timeout in milliseconds
public
long
getWaitForIdleTimeout
()
Gets the current timeout used for waiting for the user interface to go
into an idle state.
By default, all core uiautomator objects except UiDevice
will perform
this wait before starting to search for the widget specified by the
object's UiSelector
. Once the idle state is detected or the
timeout elapses (whichever occurs first), the object will start to wait
for the selector to find a match.
See setWaitForSelectorTimeout(long)
Returns
- Current timeout value in milliseconds
public
long
getWaitForSelectorTimeout
()
Gets the current timeout for waiting for a widget to become visible in
the user interface so that it can be matched by a selector.
Because user interface content is dynamic, sometimes a widget may not
be visible immediately and won't be detected by a selector. This timeout
allows the uiautomator framework to wait for a match to be found, up until
the timeout elapses.
Returns
- Current timeout value in milliseconds
public
Configurator
setActionAcknowledgmentTimeout
(long timeout)
Sets the timeout for waiting for an acknowledgment of generic uiautomator
actions, such as clicks, text setting, and menu presses.
The acknowledgment is an AccessibilityEvent,
corresponding to an action, that lets the framework determine if the
action was successful. Generally, this timeout should not be modified.
See UiObject
Parameters
timeout
| Timeout value in milliseconds |
public
Configurator
setKeyInjectionDelay
(long delay)
Sets a delay between key presses when injecting text input.
See setText(String)
Parameters
delay
| Delay value in milliseconds |
public
Configurator
setScrollAcknowledgmentTimeout
(long timeout)
Sets the timeout for waiting for an acknowledgement of an
uiautomtor scroll swipe action.
The acknowledgment is an AccessibilityEvent,
corresponding to the scroll action, that lets the framework determine if
the scroll action was successful. Generally, this timeout should not be modified.
See UiScrollable
Parameters
timeout
| Timeout value in milliseconds |
public
Configurator
setWaitForIdleTimeout
(long timeout)
Sets the timeout for waiting for the user interface to go into an idle
state before starting a uiautomator action.
By default, all core uiautomator objects except UiDevice
will perform
this wait before starting to search for the widget specified by the
object's UiSelector
. Once the idle state is detected or the
timeout elapses (whichever occurs first), the object will start to wait
for the selector to find a match.
See setWaitForSelectorTimeout(long)
Parameters
timeout
| Timeout value in milliseconds |
public
Configurator
setWaitForSelectorTimeout
(long timeout)
Sets the timeout for waiting for a widget to become visible in the user
interface so that it can be matched by a selector.
Because user interface content is dynamic, sometimes a widget may not
be visible immediately and won't be detected by a selector. This timeout
allows the uiautomator framework to wait for a match to be found, up until
the timeout elapses.
Parameters
timeout
| Timeout value in milliseconds. |