Best io.appium code snippet using io.appium.java_client.AppiumBy.ByIosClassChain
MobileBy.java
Source:MobileBy.java  
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 additional5 * information regarding copyright ownership.6 * You may obtain a copy of the License at7 *8 *     http://www.apache.org/licenses/LICENSE-2.09 *10 * Unless required by applicable law or agreed to in writing, software11 * 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 and14 * limitations under the License.15 */16package io.appium.java_client;17import java.io.Serializable;18import org.openqa.selenium.By;19/**20 * Appium locating strategies.21 *22 * @deprecated Use {@link AppiumBy} instead.23 */24@SuppressWarnings("serial")25@Deprecated26public abstract class MobileBy extends AppiumBy {27    protected MobileBy(String selector, String locatorString, String locatorName) {28        super(selector, locatorString, locatorName);29    }30    /**31     * Refer to https://developer.android.com/training/testing/ui-automator32     * @deprecated Use {@link AppiumBy#androidUIAutomator(String)} instead.33     * @param uiautomatorText is Android UIAutomator string34     * @return an instance of {@link ByAndroidUIAutomator}35     */36    @Deprecated37    public static By AndroidUIAutomator(final String uiautomatorText) {38        return new ByAndroidUIAutomator(uiautomatorText);39    }40    /**41     * About Android accessibility42     * https://developer.android.com/intl/ru/training/accessibility/accessible-app.html43     * About iOS accessibility44     * https://developer.apple.com/library/ios/documentation/UIKit/Reference/45     * UIAccessibilityIdentification_Protocol/index.html46     * @deprecated Use {@link AppiumBy#accessibilityId(String)} instead.47     * @param accessibilityId id is a convenient UI automation accessibility Id.48     * @return an instance of {@link ByAndroidUIAutomator}49     */50    @Deprecated51    public static By AccessibilityId(final String accessibilityId) {52        return new ByAccessibilityId(accessibilityId);53    }54    /**55     * This locator strategy is available in XCUITest Driver mode.56     * @deprecated Use {@link AppiumBy#iOSClassChain(String)} instead.57     * @param iOSClassChainString is a valid class chain locator string.58     *                            See <a href="https://github.com/facebookarchive/WebDriverAgent/wiki/Class-Chain-Queries-Construction-Rules">59     *                            the documentation</a> for more details60     * @return an instance of {@link ByIosClassChain}61     */62    @Deprecated63    public static By iOSClassChain(final String iOSClassChainString) {64        return new ByIosClassChain(iOSClassChainString);65    }66    /**67     * This locator strategy is only available in Espresso Driver mode.68     * @deprecated Use {@link AppiumBy#androidDataMatcher(String)} instead.69     * @param dataMatcherString is a valid json string detailing hamcrest matcher for Espresso onData().70     *                            See <a href="http://appium.io/docs/en/writing-running-appium/android/espresso-datamatcher-selector/">71     *                            the documentation</a> for more details72     * @return an instance of {@link ByAndroidDataMatcher}73     */74    @Deprecated75    public static By androidDataMatcher(final String dataMatcherString) {76        return new ByAndroidDataMatcher(dataMatcherString);77    }78    /**79     * This locator strategy is only available in Espresso Driver mode.80     * @deprecated Use {@link AppiumBy#androidViewMatcher(String)} instead.81     * @param viewMatcherString is a valid json string detailing hamcrest matcher for Espresso onView().82     *                            See <a href="http://appium.io/docs/en/writing-running-appium/android/espresso-datamatcher-selector/">83     *                            the documentation</a> for more details84     * @return an instance of {@link ByAndroidViewMatcher}85     */86    @Deprecated87    public static By androidViewMatcher(final String viewMatcherString) {88        return new ByAndroidViewMatcher(viewMatcherString);89    }90    /**91     * This locator strategy is available in XCUITest Driver mode.92     * @deprecated Use {@link AppiumBy#iOSNsPredicateString(String)} instead.93     * @param iOSNsPredicateString is an iOS NsPredicate String94     * @return an instance of {@link ByIosNsPredicate}95     */96    @Deprecated97    public static By iOSNsPredicateString(final String iOSNsPredicateString) {98        return new ByIosNsPredicate(iOSNsPredicateString);99    }100    /**101     * The Windows UIAutomation selector.102     * @deprecated Not supported on the server side.103     * @param windowsAutomation The element name in the Windows UIAutomation selector104     * @return an instance of {@link MobileBy.ByWindowsAutomation}105     */106    @Deprecated107    public static By windowsAutomation(final String windowsAutomation) {108        return new ByWindowsAutomation(windowsAutomation);109    }110    /**111     * This locator strategy is available in Espresso Driver mode.112     * @deprecated Use {@link AppiumBy#androidViewTag(String)} instead.113     * @since Appium 1.8.2 beta114     * @param tag is an view tag string115     * @return an instance of {@link ByAndroidViewTag}116     */117    @Deprecated118    public static By AndroidViewTag(final String tag) {119        return new ByAndroidViewTag(tag);120    }121    /**122     * This locator strategy is available only if OpenCV libraries and123     * NodeJS bindings are installed on the server machine.124     *125     * @deprecated Use {@link AppiumBy#image(String)} instead.126     * @see <a href="https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/image-comparison.md">127     * The documentation on Image Comparison Features</a>128     * @see <a href="https://github.com/appium/appium-base-driver/blob/master/lib/basedriver/device-settings.js">129     * The settings available for lookup fine-tuning</a>130     * @since Appium 1.8.2131     * @param b64Template base64-encoded template image string. Supported image formats are the same132     *                    as for OpenCV library.133     * @return an instance of {@link ByImage}134     */135    @Deprecated136    public static By image(final String b64Template) {137        return new ByImage(b64Template);138    }139    /**140     * This type of locator requires the use of the 'customFindModules' capability and a141     * separately-installed element finding plugin.142     *143     * @deprecated Use {@link AppiumBy#custom(String)} instead.144     * @param selector selector to pass to the custom element finding plugin145     * @return an instance of {@link ByCustom}146     * @since Appium 1.9.2147     */148    @Deprecated149    public static By custom(final String selector) {150        return new ByCustom(selector);151    }152    /**153     * Refer to https://developer.android.com/training/testing/ui-automator154     *155     * @deprecated Use {@link AppiumBy.ByAndroidUIAutomator} instead.156     */157    @Deprecated158    public static class ByAndroidUIAutomator extends AppiumBy.ByAndroidUIAutomator {159        public ByAndroidUIAutomator(String uiautomatorText) {160            super(uiautomatorText);161        }162        @Override public String toString() {163            return "By.AndroidUIAutomator: " + getRemoteParameters().value();164        }165    }166    /**167     * About Android accessibility168     * https://developer.android.com/intl/ru/training/accessibility/accessible-app.html169     * About iOS accessibility170     * https://developer.apple.com/library/ios/documentation/UIKit/Reference/171     * UIAccessibilityIdentification_Protocol/index.html172     * @deprecated Use {@link AppiumBy.ByAccessibilityId} instead.173     */174    @Deprecated175    public static class ByAccessibilityId extends AppiumBy.ByAccessibilityId {176        public ByAccessibilityId(String accessibilityId) {177            super(accessibilityId);178        }179        @Override public String toString() {180            return "By.AccessibilityId: " + getRemoteParameters().value();181        }182    }183    /**184     * This locator strategy is available in XCUITest Driver mode.185     * See <a href="https://github.com/facebookarchive/WebDriverAgent/wiki/Class-Chain-Queries-Construction-Rules">186     * the documentation</a> for more details187     * @deprecated Use {@link AppiumBy.ByIosClassChain} instead.188     */189    @Deprecated190    public static class ByIosClassChain extends AppiumBy.ByIosClassChain {191        protected ByIosClassChain(String locatorString) {192            super(locatorString);193        }194        @Override public String toString() {195            return "By.IosClassChain: " + getRemoteParameters().value();196        }197    }198    /**199     * This locator strategy is only available in Espresso Driver mode.200     * See <a href="http://appium.io/docs/en/writing-running-appium/android/espresso-datamatcher-selector/">201     * the documentation</a> for more details202     * @deprecated Use {@link AppiumBy.ByAndroidDataMatcher} instead.203     */204    @Deprecated205    public static class ByAndroidDataMatcher extends AppiumBy.ByAndroidDataMatcher {206        protected ByAndroidDataMatcher(String locatorString) {207            super(locatorString);208        }209        @Override public String toString() {210            return "By.AndroidDataMatcher: " + getRemoteParameters().value();211        }212    }213    /**214     * This locator strategy is only available in Espresso Driver mode.215     * See <a href="http://appium.io/docs/en/writing-running-appium/android/espresso-datamatcher-selector/">216     * the documentation</a> for more details217     * @deprecated Use {@link AppiumBy.ByAndroidViewMatcher} instead.218     */219    @Deprecated220    public static class ByAndroidViewMatcher extends AppiumBy.ByAndroidViewMatcher {221        protected ByAndroidViewMatcher(String locatorString) {222            super(locatorString);223        }224        @Override public String toString() {225            return "By.AndroidViewMatcher: " + getRemoteParameters().value();226        }227    }228    /**229     * This locator strategy is available in XCUITest Driver mode.230     * @deprecated Use {@link AppiumBy.ByIosNsPredicate} instead.231     */232    @Deprecated233    public static class ByIosNsPredicate extends AppiumBy.ByIosNsPredicate {234        protected ByIosNsPredicate(String locatorString) {235            super(locatorString);236        }237        @Override public String toString() {238            return "By.IosNsPredicate: " + getRemoteParameters().value();239        }240    }241    /**242     * The Windows UIAutomation selector.243     * @deprecated Not supported on the server side.244     */245    @Deprecated246    public static class ByWindowsAutomation extends MobileBy implements Serializable {247        protected ByWindowsAutomation(String locatorString) {248            super("-windows uiautomation", locatorString, "windowsAutomation");249        }250        @Override public String toString() {251            return "By.windowsAutomation: " + getRemoteParameters().value();252        }253    }254    /**255     * This locator strategy is available only if OpenCV libraries and256     * NodeJS bindings are installed on the server machine.257     * @deprecated Use {@link AppiumBy.ByImage} instead.258     */259    @Deprecated260    public static class ByImage extends AppiumBy.ByImage {261        protected ByImage(String b64Template) {262            super(b64Template);263        }264        @Override public String toString() {265            return "By.Image: " + getRemoteParameters().value();266        }267    }268    /**269     * This type of locator requires the use of the 'customFindModules' capability and a270     * separately-installed element finding plugin.271     * @deprecated Use {@link AppiumBy.ByCustom} instead.272     */273    @Deprecated274    public static class ByCustom extends AppiumBy.ByCustom {275        protected ByCustom(String selector) {276            super(selector);277        }278        @Override public String toString() {279            return "By.Custom: " + getRemoteParameters().value();280        }281    }282    /**283     * This locator strategy is available in Espresso Driver mode.284     * @deprecated Use {@link AppiumBy.ByAndroidViewTag} instead.285     */286    @Deprecated287    public static class ByAndroidViewTag extends AppiumBy.ByAndroidViewTag {288        public ByAndroidViewTag(String tag) {289            super(tag);290        }291        @Override public String toString() {292            return "By.AndroidViewTag: " + getRemoteParameters().value();293        }294    }295}...AppiumBy.java
Source:AppiumBy.java  
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 additional5 * information regarding copyright ownership.6 * You may obtain a copy of the License at7 *8 *     http://www.apache.org/licenses/LICENSE-2.09 *10 * Unless required by applicable law or agreed to in writing, software11 * 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 and14 * limitations under the License.15 */16package io.appium.java_client;17import lombok.Getter;18import org.apache.commons.lang3.Validate;19import org.openqa.selenium.By;20import org.openqa.selenium.By.Remotable;21import org.openqa.selenium.SearchContext;22import org.openqa.selenium.WebElement;23import java.io.Serializable;24import java.util.List;25public abstract class AppiumBy extends By implements Remotable {26    @Getter private final Parameters remoteParameters;27    private final String locatorName;28    protected AppiumBy(String selector, String locatorString, String locatorName) {29        Validate.notBlank(locatorString, "Must supply a not empty locator value.");30        this.remoteParameters = new Parameters(selector, locatorString);31        this.locatorName = locatorName;32    }33    @Override public List<WebElement> findElements(SearchContext context) {34        return context.findElements(this);35    }36    @Override public WebElement findElement(SearchContext context) {37        return context.findElement(this);38    }39    @Override public String toString() {40        return String.format("%s.%s: %s", AppiumBy.class.getSimpleName(), locatorName, remoteParameters.value());41    }42    /**43     * About Android accessibility44     * https://developer.android.com/intl/ru/training/accessibility/accessible-app.html45     * About iOS accessibility46     * https://developer.apple.com/library/ios/documentation/UIKit/Reference/47     * UIAccessibilityIdentification_Protocol/index.html48     * @param accessibilityId id is a convenient UI automation accessibility Id.49     * @return an instance of {@link AppiumBy.ByAndroidUIAutomator}50     */51    public static By accessibilityId(final String accessibilityId) {52        return new ByAccessibilityId(accessibilityId);53    }54    /**55     * This locator strategy is only available in Espresso Driver mode.56     * @param dataMatcherString is a valid json string detailing hamcrest matcher for Espresso onData().57     *                            See <a href="http://appium.io/docs/en/writing-running-appium/android/espresso-datamatcher-selector/">58     *                            the documentation</a> for more details59     * @return an instance of {@link AppiumBy.ByAndroidDataMatcher}60     */61    public static By androidDataMatcher(final String dataMatcherString) {62        return new ByAndroidDataMatcher(dataMatcherString);63    }64    /**65     * Refer to https://developer.android.com/training/testing/ui-automator66     * @param uiautomatorText is Android UIAutomator string67     * @return an instance of {@link AppiumBy.ByAndroidUIAutomator}68     */69    public static By androidUIAutomator(final String uiautomatorText) {70        return new ByAndroidUIAutomator(uiautomatorText);71    }72    /**73     * This locator strategy is only available in Espresso Driver mode.74     * @param viewMatcherString is a valid json string detailing hamcrest matcher for Espresso onView().75     *                            See <a href="http://appium.io/docs/en/writing-running-appium/android/espresso-datamatcher-selector/">76     *                            the documentation</a> for more details77     * @return an instance of {@link AppiumBy.ByAndroidViewMatcher}78     */79    public static By androidViewMatcher(final String viewMatcherString) {80        return new ByAndroidViewMatcher(viewMatcherString);81    }82    /**83     * This locator strategy is available in Espresso Driver mode.84     * @since Appium 1.8.2 beta85     * @param tag is a view tag string86     * @return an instance of {@link ByAndroidViewTag}87     */88    public static By androidViewTag(final String tag) {89        return new ByAndroidViewTag(tag);90    }91    /**92     * For IOS it is the full name of the XCUI element and begins with XCUIElementType.93     * For Android it is the full name of the UIAutomator2 class (e.g.: android.widget.TextView)94     * @param selector the class name of the element95     * @return an instance of {@link ByClassName}96     */97    public static By className(final String selector) {98        return new ByClassName(selector);99    }100    /**101     * For IOS the element name.102     * For Android it is the resource identifier.103     * @param selector element id104     * @return an instance of {@link ById}105     */106    public static By id(final String selector) {107        return new ById(selector);108    }109    /**110     * For IOS the element name.111     * For Android it is the resource identifier.112     * @param selector element id113     * @return an instance of {@link ByName}114     */115    public static By name(final String selector) {116        return new ByName(selector);117    }118    /**119     * This type of locator requires the use of the 'customFindModules' capability and a120     * separately-installed element finding plugin.121     *122     * @param selector selector to pass to the custom element finding plugin123     * @return an instance of {@link ByCustom}124     * @since Appium 1.9.2125     */126    public static By custom(final String selector) {127        return new ByCustom(selector);128    }129    /**130     * This locator strategy is available only if OpenCV libraries and131     * NodeJS bindings are installed on the server machine.132     *133     * @see <a href="https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/image-comparison.md">134     * The documentation on Image Comparison Features</a>135     * @see <a href="https://github.com/appium/appium-base-driver/blob/master/lib/basedriver/device-settings.js">136     * The settings available for lookup fine-tuning</a>137     * @since Appium 1.8.2138     * @param b64Template base64-encoded template image string. Supported image formats are the same139     *                    as for OpenCV library.140     * @return an instance of {@link ByImage}141     */142    public static By image(final String b64Template) {143        return new ByImage(b64Template);144    }145    /**146     * This locator strategy is available in XCUITest Driver mode.147     * @param iOSClassChainString is a valid class chain locator string.148     *                            See <a href="https://github.com/facebookarchive/WebDriverAgent/wiki/Class-Chain-Queries-Construction-Rules">149     *                            the documentation</a> for more details150     * @return an instance of {@link AppiumBy.ByIosClassChain}151     */152    public static By iOSClassChain(final String iOSClassChainString) {153        return new ByIosClassChain(iOSClassChainString);154    }155    /**156     * This locator strategy is available in XCUITest Driver mode.157     * @param iOSNsPredicateString is an iOS NsPredicate String158     * @return an instance of {@link AppiumBy.ByIosNsPredicate}159     */160    public static By iOSNsPredicateString(final String iOSNsPredicateString) {161        return new ByIosNsPredicate(iOSNsPredicateString);162    }163    public static class ByAccessibilityId extends AppiumBy implements Serializable {164        public ByAccessibilityId(String accessibilityId) {165            super("accessibility id", accessibilityId, "accessibilityId");166        }167    }168    public static class ByAndroidDataMatcher extends AppiumBy implements Serializable {169        protected ByAndroidDataMatcher(String locatorString) {170            super("-android datamatcher", locatorString, "androidDataMatcher");171        }172    }173    public static class ByAndroidUIAutomator extends AppiumBy implements Serializable {174        public ByAndroidUIAutomator(String uiautomatorText) {175            super("-android uiautomator", uiautomatorText, "androidUIAutomator");176        }177    }178    public static class ByAndroidViewMatcher extends AppiumBy implements Serializable {179        protected ByAndroidViewMatcher(String locatorString) {180            super("-android viewmatcher", locatorString, "androidViewMatcher");181        }182    }183    public static class ByAndroidViewTag extends AppiumBy implements Serializable {184        public ByAndroidViewTag(String tag) {185            super("-android viewtag", tag, "androidViewTag");186        }187    }188    public static class ById extends AppiumBy implements Serializable {189        protected ById(String selector) {190            super("id", selector, "id");191        }192    }193    public static class ByName extends AppiumBy implements Serializable {194        protected ByName(String selector) {195            super("name", selector, "name");196        }197    }198    public static class ByClassName extends AppiumBy implements Serializable {199        protected ByClassName(String selector) {200            super("class name", selector, "className");201        }202    }203    public static class ByCustom extends AppiumBy implements Serializable {204        protected ByCustom(String selector) {205            super("-custom", selector, "custom");206        }207    }208    public static class ByImage extends AppiumBy implements Serializable {209        protected ByImage(String b64Template) {210            super("-image", b64Template, "image");211        }212    }213    public static class ByIosClassChain extends AppiumBy implements Serializable {214        protected ByIosClassChain(String locatorString) {215            super("-ios class chain", locatorString, "iOSClassChain");216        }217    }218    public static class ByIosNsPredicate extends AppiumBy implements Serializable {219        protected ByIosNsPredicate(String locatorString) {220            super("-ios predicate string", locatorString, "iOSNsPredicate");221        }222    }223}...AppiumBy.ByIosClassChain
Using AI Code Generation
1package appium.java;2import java.io.File;3import java.net.MalformedURLException;4import java.net.URL;5import org.openqa.selenium.remote.DesiredCapabilities;6import io.appium.java_client.AppiumDriver;7import io.appium.java_client.MobileElement;8import io.appium.java_client.ios.IOSDriver;9import io.appium.java_client.remote.MobileCapabilityType;10import io.appium.java_client.service.local.AppiumDriverLocalService;11import io.appium.java_client.service.local.AppiumServiceBuilder;12public class AppiumByByIosClassChain {13	public static void main(String[] args) throws MalformedURLException {14		AppiumDriverLocalService service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingDriverExecutable(new File("C:\\Program Files\\nodejs\\node.exe"))15				.withAppiumJS(new File("C:\\Users\\DELL\\AppData\\Roaming\\npm\\node_modules\\appium\\build\\lib\\main.js"))16				.withLogFile(new File("C:\\Users\\DELL\\AppData\\Local\\Temp\\appiumlogs\\logs.txt")));17		service.start();18		DesiredCapabilities cap = new DesiredCapabilities();19		cap.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 7");20		cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");21		cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, "13.3");22		cap.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");23		cap.setCapability(MobileCapabilityType.UDID, "00008030-000E4D1C1E68002E");24		cap.setCapability(MobileCapabilityType.APP, "C:\\Users\\DELL\\Desktop\\UICatalog.app.zip");AppiumBy.ByIosClassChain
Using AI Code Generation
1import io.appium.java_client.MobileBy;2import io.appium.java_client.AppiumBy;3		.classChain("**/XCUIElementTypeOther[`name == \"Add to Cart\"`]"));4from appium.webdriver.common.mobileby import AppiumBy5element = @@driver.find_element(Appium::By::IOS_CLASS_CHAIN,6var AppiumBy = require('appium').By;7		classChain("**/XCUIElementTypeOther[`name == \"Add to Cart\"`]"));8import "github.com/appium/go-appium/appium"9element := driver.FindElement(appium.ByIosClassChain("**/XCUIElementTypeOther[`name == \"Add to Cart\"`]"))10use Facebook\WebDriver\Remote\RemoteWebDriver;11use Facebook\WebDriver\Remote\DesiredCapabilities;12use Facebook\WebDriver\WebDriverBy;13use Facebook\WebDriver\WebDriverExpectedCondition;14use Facebook\WebDriver\WebDriverWait;15use Facebook\WebDriver\WebDriverElement;16use Facebook\WebDriver\WebDriverDimension;17use Appium\WebDriver\AppiumBy;18$driver = RemoteWebDriver::create($host, $capabilities, 5000);19$element = $driver->findElement(AppiumBy::iosClassChain("**/XCUIElementTypeOther[`name == \"Add to Cart\"`]"));AppiumBy.ByIosClassChain
Using AI Code Generation
1import io.appium.java_client.AppiumDriver;2import io.appium.java_client.MobileElement;3import io.appium.java_client.ios.IOSDriver;4import io.appium.java_client.remote.MobileCapabilityType;5import io.appium.java_client.AppiumBy;6import org.openqa.selenium.remote.DesiredCapabilities;7import java.net.URL;8import java.net.MalformedURLException;9import java.util.logging.Level;10public class AppiumByByIosClassChain {11    private static AppiumDriver<MobileElement> driver = null;12    public static void main(String[] args) {13        try {14            DesiredCapabilities dc = new DesiredCapabilities();15            dc.setCapability("platformName", "iOS");16            dc.setCapability("platformVersion", "13.4");17            dc.setCapability("deviceName", "iPhone 11");18            dc.setCapability("udid", "00008020-000E3D2A2E38002E");19            dc.setCapability("automationName", "XCUITest");20            dc.setCapability("bundleId", "com.apple.mobilecal");AppiumBy.ByIosClassChain
Using AI Code Generation
1import io.appium.java_client.AppiumDriver;2import io.appium.java_client.MobileElement;3import io.appium.java_client.ios.IOSDriver;4import io.appium.java_client.remote.MobileCapabilityType;5import io.appium.java_client.service.local.AppiumDriverLocalService;6import io.appium.java_client.service.local.AppiumServiceBuilder;7import org.openqa.selenium.By;8import org.openqa.selenium.remote.DesiredCapabilities;9import java.io.File;10import java.io.IOException;11import java.net.URL;12import java.util.concurrent.TimeUnit;13public class appium {14    public static void main(String[] args) throws IOException, InterruptedException {15        AppiumDriverLocalService service = AppiumDriverLocalService.buildService(16                new AppiumServiceBuilder()17                        .usingDriverExecutable(new File("/usr/local/bin/node"))18                        .withAppiumJS(new File("/usr/local/lib/node_modules/appium/build/lib/main.js"))19                        .withIPAddress("Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
