How to use configuratorSetWaitForIdleTimeout method of io.appium.java_client.android.HasAndroidSettings class

Best io.appium code snippet using io.appium.java_client.android.HasAndroidSettings.configuratorSetWaitForIdleTimeout

Run io.appium automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

HasAndroidSettings.java

Source: HasAndroidSettings.java Github

copy
1/*
2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * See the NOTICE file distributed with this work for additional
5 * information regarding copyright ownership.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package io.appium.java_client.android;
18
19import io.appium.java_client.HasSettings;
20import io.appium.java_client.Setting;
21
22import java.time.Duration;
23
24interface HasAndroidSettings extends HasSettings {
25    /**
26     * Set the `ignoreUnimportantViews` setting. *Android-only method*.
27     * Sets whether Android devices should use `setCompressedLayoutHeirarchy()`
28     * which ignores all views which are marked IMPORTANT_FOR_ACCESSIBILITY_NO
29     * or IMPORTANT_FOR_ACCESSIBILITY_AUTO (and have been deemed not important
30     * by the system), in an attempt to make things less confusing or faster.
31     *
32     * @param compress ignores unimportant views if true, doesn't ignore otherwise.
33     * @return self instance for chaining
34     */
35    default HasAndroidSettings ignoreUnimportantViews(Boolean compress) {
36        return (HasAndroidSettings) setSetting(Setting.IGNORE_UNIMPORTANT_VIEWS, compress);
37    }
38
39    /**
40     * invoke {@code setWaitForIdleTimeout} in {@code com.android.uiautomator.core.Configurator}.
41     *
42     * @param timeout A negative value would reset to its default value. Minimum time unit
43     *                resolution is one millisecond
44     * @return self instance for chaining
45     */
46    default HasAndroidSettings configuratorSetWaitForIdleTimeout(Duration timeout) {
47        return (HasAndroidSettings) setSetting(Setting.WAIT_FOR_IDLE_TIMEOUT, timeout.toMillis());
48    }
49
50    /**
51     * invoke {@code setWaitForSelectorTimeout} in {@code com.android.uiautomator.core.Configurator}.
52     *
53     * @param timeout A negative value would reset to its default value. Minimum time unit
54     *                resolution is one millisecond
55     * @return self instance for chaining
56     */
57    default HasAndroidSettings configuratorSetWaitForSelectorTimeout(Duration timeout) {
58        return (HasAndroidSettings) setSetting(Setting.WAIT_FOR_SELECTOR_TIMEOUT, timeout.toMillis());
59    }
60
61    /**
62     * invoke {@code setScrollAcknowledgmentTimeout} in {@code com.android.uiautomator.core.Configurator}.
63     *
64     * @param timeout A negative value would reset to its default value. Minimum time unit
65     *                resolution is one millisecond
66     * @return self instance for chaining
67     */
68    default HasAndroidSettings configuratorSetScrollAcknowledgmentTimeout(Duration timeout) {
69        return (HasAndroidSettings) setSetting(Setting.WAIT_SCROLL_ACKNOWLEDGMENT_TIMEOUT, timeout.toMillis());
70    }
71
72    /**
73     * invoke {@code configuratorSetKeyInjectionDelay} in {@code com.android.uiautomator.core.Configurator}.
74     *
75     * @param delay A negative value would reset to its default value. Minimum time unit
76     *              resolution is one millisecond
77     * @return self instance for chaining
78     */
79    default HasAndroidSettings configuratorSetKeyInjectionDelay(Duration delay) {
80        return (HasAndroidSettings) setSetting(Setting.KEY_INJECTION_DELAY, delay.toMillis());
81    }
82
83    /**
84     * invoke {@code setActionAcknowledgmentTimeout} in {@code com.android.uiautomator.core.Configurator}.
85     *
86     * @param timeout A negative value would reset to its default value. Minimum time unit
87     *                resolution is one millisecond
88     * @return self instance for chaining
89     */
90    default HasAndroidSettings configuratorSetActionAcknowledgmentTimeout(Duration timeout) {
91        return (HasAndroidSettings) setSetting(Setting.WAIT_ACTION_ACKNOWLEDGMENT_TIMEOUT, timeout.toMillis());
92    }
93
94    /**
95     * Setting this value to true will enforce source tree dumper
96     * to transliterate all class names used as XML tags to the limited
97     * set of ASCII characters supported by Apache Harmony
98     * lib and used by default in Android to avoid possible
99     * XML parsing exceptions caused by XPath lookup.
100     * The Unicode to ASCII transliteration is based on
101     * JUnidecode library (https://github.com/gcardone/junidecode).
102     * Works for UIAutomator2 only.
103     *
104     * @param enabled Either true or false. The default value if false.
105     * @return self instance for chaining
106     */
107    default HasAndroidSettings normalizeTagNames(boolean enabled) {
108        return (HasAndroidSettings) setSetting(Setting.NORMALIZE_TAG_NAMES, enabled);
109    }
110
111    /**
112     * Whether to return compact (standards-compliant) and faster responses in find element/s
113     * (the default setting). If set to false then the response may also contain other
114     * available element attributes.
115     *
116     * @param enabled Either true or false. The default value if true.
117     * @return self instance for chaining
118     */
119    default HasAndroidSettings setShouldUseCompactResponses(boolean enabled) {
120        return (HasAndroidSettings) setSetting(Setting.SHOULD_USE_COMPACT_RESPONSES, enabled);
121    }
122
123    /**
124     * Which attributes should be returned if compact responses are disabled.
125     * It works only if shouldUseCompactResponses is false. Defaults to "" (empty string).
126     *
127     * @param attrNames The comma-separated list of fields to return with each element.
128     * @return self instance for chaining
129     */
130    default HasAndroidSettings setElementResponseAttributes(String attrNames) {
131        return (HasAndroidSettings) setSetting(Setting.ELEMENT_RESPONSE_ATTRIBUTES, attrNames);
132    }
133
134    /**
135     * Set whether the source output/xpath search should consider all elements, visible and invisible.
136     * Disabling this setting speeds up source and xml search. Works for UIAutomator2 only.
137     *
138     * @param enabled Either true or false. The default value if false.
139     * @return self instance for chaining
140     */
141    default HasAndroidSettings allowInvisibleElements(boolean enabled) {
142        return (HasAndroidSettings) setSetting(Setting.ALLOW_INVISIBLE_ELEMENTS, enabled);
143    }
144
145    /**
146     * Whether to enable or disable the notification listener.
147     * No toast notifications are going to be added into page source output if
148     * this setting is disabled.
149     * Works for UIAutomator2 only.
150     *
151     * @param enabled Either true or false. The default value if true.
152     * @return self instance for chaining
153     */
154    default HasAndroidSettings enableNotificationListener(boolean enabled) {
155        return (HasAndroidSettings) setSetting(Setting.ENABLE_NOTIFICATION_LISTENER, enabled);
156    }
157
158    /**
159     * Whether to enable or disable shutdown the server through
160     * the broadcast receiver on ACTION_POWER_DISCONNECTED.
161     *
162     * @param enabled Either true or false. The default value if true.
163     * @return self instance for chaining
164     */
165    default HasAndroidSettings shutdownOnPowerDisconnect(boolean enabled) {
166        return (HasAndroidSettings) setSetting(Setting.SHUTDOWN_ON_POWER_DISCONNECT, enabled);
167    }
168
169    /**
170     * Turn on or off the tracking of scroll events as they happen.
171     * If {@code true}, a field {@code lastScrollData} is added to the results of
172     * {@code getSession}, which can then be used to check on scroll progress.
173     * Turning this feature off significantly increases touch action performance.
174     *
175     * @param enabled Either true or false. The default value if true.
176     * @return self instance for chaining
177     */
178    default HasAndroidSettings setTrackScrollEvents(boolean enabled) {
179        return (HasAndroidSettings) setSetting(Setting.TRACK_SCROLL_EVENTS, enabled);
180    }
181}
182
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Trigger configuratorSetWaitForIdleTimeout code on LambdaTest Cloud Grid

Execute automation tests with configuratorSetWaitForIdleTimeout on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)