I am starting the appium server using the following code snippet and it works fine:
@BeforeTest
public void appstart() {
AppiumDriverLocalService service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder()
.usingDriverExecutable(new File("/Applications/Appium.app/Contents/Resources/node/bin/node"))
.withAppiumJS(new File("/Applications/Appium.app/Contents/Resources/node_modules/appium/bin/appium.js"))
.withLogFile(new File("/Users/Desktop/logs.txt")));
service.start();
try {
//setting the capabilities
} catch (Exception e) {
e.printStackTrace();
}
}
Now I need to go on with parallel execution. If I use grid I need to create different nodeconfig.json files which includes the appium instance details. If I need to run my test in three device is it necessary to create three different nodeconfig.json files? Is it possible to use the same code snippet to start the appium for parallel execution, if so how?