Created
October 15, 2022 03:51
-
-
Save mfaisalkhatri/b48f474f0aa1d926d7b01415947fdf9e to your computer and use it in GitHub Desktop.
Start Appium server Programmatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void startServer () { | |
AppiumServiceBuilder builder = new AppiumServiceBuilder (); | |
builder.withIPAddress ("127.0.0.1") | |
.usingPort (4723) | |
.withAppiumJS ( | |
new File ("C:\\Users\\Windows\\AppData\\Roaming\\npm\\node_modules\\appium\\build\\lib\\main.js")) | |
.usingDriverExecutable (new File ("E:\\Program Files\\nodejs\\node.exe")) | |
.withArgument (BASEPATH, "/wd/hub") | |
.withArgument (GeneralServerFlag.SESSION_OVERRIDE) | |
.withArgument (GeneralServerFlag.LOG_LEVEL, "debug"); | |
service = AppiumDriverLocalService.buildService (builder); | |
service.start (); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment