How to use HasIOSSettings class of io.appium.java_client.ios package

Best io.appium code snippet using io.appium.java_client.ios.HasIOSSettings

Run io.appium automation tests on LambdaTest cloud grid

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

HasIOSSettings.java

Source: HasIOSSettings.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.ios;
18
19import io.appium.java_client.HasSettings;
20import io.appium.java_client.Setting;
21
22interface HasIOSSettings extends HasSettings {
23    /**
24     * Set the `nativeWebTap` setting. *iOS-only method*.
25     * Sets whether Safari/webviews should convert element taps into x/y taps.
26     *
27     * @param enabled turns nativeWebTap on if true, off if false
28     * @return self instance for chaining
29     */
30    default HasIOSSettings nativeWebTap(Boolean enabled) {
31        return (HasIOSSettings) setSetting(Setting.NATIVE_WEB_TAP, enabled);
32    }
33
34    /**
35     * Whether to return compact (standards-compliant) and faster responses from find element/s
36     * (the default setting). If set to false then the response may also contain other
37     * available element attributes.
38     *
39     * @param enabled Either true or false. The default value if true.
40     * @return self instance for chaining
41     */
42    default HasIOSSettings setShouldUseCompactResponses(boolean enabled) {
43        return (HasIOSSettings) setSetting(Setting.SHOULD_USE_COMPACT_RESPONSES, enabled);
44    }
45
46    /**
47     * Which attributes should be returned if compact responses are disabled.
48     * It works only if shouldUseCompactResponses is set to false. Defaults to "type,label" string.
49     *
50     * @param attrNames The comma-separated list of fields to return with each element.
51     * @return self instance for chaining
52     */
53    default HasIOSSettings setElementResponseAttributes(String attrNames) {
54        return (HasIOSSettings) setSetting(Setting.ELEMENT_RESPONSE_ATTRIBUTES, attrNames);
55    }
56
57    /**
58     * The quality of the screenshots generated by the screenshots broadcaster,
59     * The value of 0 represents the maximum compression
60     * (or lowest quality) while the value of 100 represents the least compression (or best quality).
61     *
62     * @param quality An integer in range 0..100. The default value is 25.
63     * @return self instance for chaining
64     */
65    default HasIOSSettings setMjpegServerScreenshotQuality(int quality) {
66        return (HasIOSSettings) setSetting(Setting.MJPEG_SERVER_SCREENSHOT_QUALITY, quality);
67    }
68
69    /**
70     * The frame rate at which the background screenshots broadcaster should broadcast screenshots in range 1..60.
71     * The default value is 10 (Frames Per Second).
72     * Setting zero value will cause the frame rate to be at its maximum possible value.
73     *
74     * @param framerate An integer in range 1..60. The default value is 10.
75     * @return self instance for chaining
76     */
77    default HasIOSSettings setMjpegServerFramerate(int framerate) {
78        return (HasIOSSettings) setSetting(Setting.MJPEG_SERVER_FRAMERATE, framerate);
79    }
80
81    /**
82     * Changes the quality of phone display screenshots according to XCTest/XCTImageQuality enum.
83     * Sometimes setting this value to the maximum possible quality may crash XCTest because of
84     * lack of the memory (lossless screenshot require more space).
85     *
86     * @param quality An integer in range 0..2. The default value is 1.
87     * @return self instance for chaining
88     */
89    default HasIOSSettings setScreenshotQuality(int quality) {
90        return (HasIOSSettings) setSetting(Setting.SCREENSHOT_QUALITY, quality);
91    }
92
93    /**
94     * The scale of screenshots in range 1..100.
95     * The default value is 100, no scaling
96     *
97     * @param scale An integer in range 1..100. The default value is 100.
98     * @return self instance for chaining
99     */
100    default HasIOSSettings setMjpegScalingFactor(int scale) {
101        return (HasIOSSettings) setSetting(Setting.MJPEG_SCALING_FACTOR, scale);
102    }
103
104    /**
105     * Changes the 'Auto-Correction' preference in Keyboards setting.
106     *
107     * @param enabled Either true or false. Defaults to false when WDA starts as xctest.
108     * @return self instance for chaining
109     */
110    default HasIOSSettings setKeyboardAutocorrection(boolean enabled) {
111        return (HasIOSSettings) setSetting(Setting.KEYBOARD_AUTOCORRECTION, enabled);
112    }
113
114    /**
115     * Changes the 'Predictive' preference in Keyboards setting.
116     *
117     * @param enabled Either true or false. Defaults to false when WDA starts as xctest.
118     * @return self instance for chaining
119     */
120    default HasIOSSettings setKeyboardPrediction(boolean enabled) {
121        return (HasIOSSettings) setSetting(Setting.KEYBOARD_PREDICTION, enabled);
122    }
123}
124
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

Run Selenium Automation Tests on LambdaTest Cloud Grid

Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.

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)