How to use setAbsoluteWebLocations method of io.appium.java_client.ios.options.webview.SupportsAbsoluteWebLocationsOption class

Best io.appium code snippet using io.appium.java_client.ios.options.webview.SupportsAbsoluteWebLocationsOption.setAbsoluteWebLocations

Run io.appium automation tests on LambdaTest cloud grid

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

SupportsAbsoluteWebLocationsOption.java

Source: SupportsAbsoluteWebLocationsOption.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.options.webview;
18
19import io.appium.java_client.remote.options.BaseOptions;
20import io.appium.java_client.remote.options.CanSetCapability;
21import org.openqa.selenium.Capabilities;
22
23import java.util.Optional;
24
25import static io.appium.java_client.internal.CapabilityHelpers.toSafeBoolean;
26
27public interface SupportsAbsoluteWebLocationsOption<T extends BaseOptions<T>> extends
28        Capabilities, CanSetCapability<T> {
29    String ABSOLUTE_WEB_LOCATIONS_OPTION = "absoluteWebLocations";
30
31    /**
32     * Enforces Get Element Location to return coordinates
33     * relative to the page origin for web view elements.
34     *
35     * @return self instance for chaining.
36     */
37    default T absoluteWebLocations() {
38        return amend(ABSOLUTE_WEB_LOCATIONS_OPTION, true);
39    }
40
41    /**
42     * This capability will direct the Get Element Location command, when used
43     * within webviews, to return coordinates which are relative to the origin of
44     * the page, rather than relative to the current scroll offset. This capability
45     * has no effect outside of webviews. Default false.
46     *
47     * @param value Whether to return coordinates relative to the page origin for web view elements.
48     * @return self instance for chaining.
49     */
50    default T setAbsoluteWebLocations(boolean value) {
51        return amend(ABSOLUTE_WEB_LOCATIONS_OPTION, value);
52    }
53
54    /**
55     * Get whether Get Element Location returns coordinates
56     * relative to the page origin for web view elements.
57     *
58     * @return True or false.
59     */
60    default Optional<Boolean> doesAbsoluteWebLocations() {
61        return Optional.ofNullable(toSafeBoolean(getCapability(ABSOLUTE_WEB_LOCATIONS_OPTION)));
62    }
63}
64
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 SupportsAbsoluteWebLocationsOption

Trigger setAbsoluteWebLocations code on LambdaTest Cloud Grid

Execute automation tests with setAbsoluteWebLocations 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)