FileDocCategorySizeDatePackage
Configurator.javaAPI DocAndroid 5.1 API8480Thu Mar 12 22:22:08 GMT 2015com.android.uiautomator.core

Configurator

public final class Configurator extends Object
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 {@link #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.
since
API Level 18

Fields Summary
private long
mWaitForIdleTimeout
private long
mWaitForSelector
private long
mWaitForActionAcknowledgment
private long
mScrollEventWaitTimeout
private long
mKeyInjectionDelay
private static Configurator
sConfigurator
Constructors Summary
private Configurator()


      
        /* hide constructor */
    
Methods Summary
public longgetActionAcknowledgmentTimeout()
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 {@link UiObject}

return
current timeout in milliseconds
since
API Level 18

        return mWaitForActionAcknowledgment;
    
public static com.android.uiautomator.core.ConfiguratorgetInstance()
Retrieves a singleton instance of Configurator.

return
Configurator instance
since
API Level 18

        if (sConfigurator == null) {
            sConfigurator = new Configurator();
        }
        return sConfigurator;
    
public longgetKeyInjectionDelay()
Gets the current delay between key presses when injecting text input. See {@link UiObject#setText(String)}

return
current delay in milliseconds
since
API Level 18

        return mKeyInjectionDelay;
    
public longgetScrollAcknowledgmentTimeout()
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 {@link UiScrollable}

return
current timeout in milliseconds
since
API Level 18

        return mScrollEventWaitTimeout;
    
public longgetWaitForIdleTimeout()
Gets the current timeout used for waiting for the user interface to go into an idle state. By default, all core uiautomator objects except {@link UiDevice} will perform this wait before starting to search for the widget specified by the object's {@link 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 {@link #setWaitForSelectorTimeout(long)}

return
Current timeout value in milliseconds
since
API Level 18

        return mWaitForIdleTimeout;
    
public longgetWaitForSelectorTimeout()
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.

return
Current timeout value in milliseconds
since
API Level 18

        return mWaitForSelector;
    
public com.android.uiautomator.core.ConfiguratorsetActionAcknowledgmentTimeout(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 {@link UiObject}

param
timeout Timeout value in milliseconds
return
self
since
API Level 18

        mWaitForActionAcknowledgment = timeout;
        return this;
    
public com.android.uiautomator.core.ConfiguratorsetKeyInjectionDelay(long delay)
Sets a delay between key presses when injecting text input. See {@link UiObject#setText(String)}

param
delay Delay value in milliseconds
return
self
since
API Level 18

        mKeyInjectionDelay = delay;
        return this;
    
public com.android.uiautomator.core.ConfiguratorsetScrollAcknowledgmentTimeout(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 {@link UiScrollable}

param
timeout Timeout value in milliseconds
return
self
since
API Level 18

        mScrollEventWaitTimeout = timeout;
        return this;
    
public com.android.uiautomator.core.ConfiguratorsetWaitForIdleTimeout(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 {@link UiDevice} will perform this wait before starting to search for the widget specified by the object's {@link 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 {@link #setWaitForSelectorTimeout(long)}

param
timeout Timeout value in milliseconds
return
self
since
API Level 18

        mWaitForIdleTimeout = timeout;
        return this;
    
public com.android.uiautomator.core.ConfiguratorsetWaitForSelectorTimeout(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.

param
timeout Timeout value in milliseconds.
return
self
since
API Level 18

        mWaitForSelector = timeout;
        return this;