How to use setWdaBaseUrl method of io.appium.java_client.ios.options.wda.SupportsWdaBaseUrlOption class

Best io.appium code snippet using io.appium.java_client.ios.options.wda.SupportsWdaBaseUrlOption.setWdaBaseUrl

Run io.appium automation tests on LambdaTest cloud grid

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

SupportsWdaBaseUrlOption.java

Source: SupportsWdaBaseUrlOption.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.wda;
18
19import io.appium.java_client.internal.CapabilityHelpers;
20import io.appium.java_client.remote.options.BaseOptions;
21import io.appium.java_client.remote.options.CanSetCapability;
22import org.openqa.selenium.Capabilities;
23
24import java.net.URL;
25import java.util.Optional;
26
27public interface SupportsWdaBaseUrlOption<T extends BaseOptions<T>> extends
28        Capabilities, CanSetCapability<T> {
29    String WDA_BASE_URL_OPTION = "wdaBaseUrl";
30
31    /**
32     * This value, if specified, will be used as a prefix to build a custom
33     * WebDriverAgent url. It is different from webDriverAgentUrl, because
34     * if the latter is set then it expects WebDriverAgent to be already
35     * listening and skips the building phase. Defaults to http://localhost.
36     *
37     * @param url The URL prefix.
38     * @return self instance for chaining.
39     */
40    default T setWdaBaseUrl(URL url) {
41        return amend(WDA_BASE_URL_OPTION, url.toString());
42    }
43
44    /**
45     * This value, if specified, will be used as a prefix to build a custom
46     * WebDriverAgent url. It is different from webDriverAgentUrl, because
47     * if the latter is set then it expects WebDriverAgent to be already
48     * listening and skips the building phase. Defaults to http://localhost.
49     *
50     * @param url The URL prefix.
51     * @return self instance for chaining.
52     */
53    default T setWdaBaseUrl(String url) {
54        return amend(WDA_BASE_URL_OPTION, url);
55    }
56
57    /**
58     * Get a prefix to build a custom WebDriverAgent URL.
59     *
60     * @return The URL prefix.
61     */
62    default Optional<URL> getWdaBaseUrl() {
63        return Optional.ofNullable(getCapability(WDA_BASE_URL_OPTION))
64                .map(CapabilityHelpers::toUrl);
65    }
66}
67
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 SupportsWdaBaseUrlOption

Trigger setWdaBaseUrl code on LambdaTest Cloud Grid

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