How to use doesUseNativeCachingStrategy method of io.appium.java_client.ios.options.wda.SupportsUseNativeCachingStrategyOption class

Best io.appium code snippet using io.appium.java_client.ios.options.wda.SupportsUseNativeCachingStrategyOption.doesUseNativeCachingStrategy

Run io.appium automation tests on LambdaTest cloud grid

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

Source: Github

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 *
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 */
17package io.appium.java_client.ios.options.wda;
19import io.appium.java_client.remote.options.BaseOptions;
20import io.appium.java_client.remote.options.CanSetCapability;
21import org.openqa.selenium.Capabilities;
23import java.util.Optional;
25import static io.appium.java_client.internal.CapabilityHelpers.toSafeBoolean;
27public interface SupportsUseNativeCachingStrategyOption<T extends BaseOptions<T>> extends
28        Capabilities, CanSetCapability<T> {
29    String USE_NATIVE_CACHING_STRATEGY_OPTION = "useNativeCachingStrategy";
31    /**
32     * Set this capability to false in order to use the custom elements caching
33     * strategy. This might help to avoid stale element exception on property
34     * change. By default, the native XCTest cache resolution is used (true)
35     * for all native locators (e.g. all, but xpath).
36     *
37     * @param value Whether to use the native caching strategy.
38     * @return self instance for chaining.
39     */
40    default T setUseNativeCachingStrategy(boolean value) {
41        return amend(USE_NATIVE_CACHING_STRATEGY_OPTION, value);
42    }
44    /**
45     * Get whether to use the native caching strategy.
46     *
47     * @return True or false.
48     */
49    default Optional<Boolean> doesUseNativeCachingStrategy() {
50        return Optional.ofNullable(toSafeBoolean(getCapability(USE_NATIVE_CACHING_STRATEGY_OPTION)));
51    }
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

Most used method in SupportsUseNativeCachingStrategyOption

Trigger doesUseNativeCachingStrategy code on LambdaTest Cloud Grid

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

Test now for Free

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

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)