Appium parallel execution issue with testng.xml


i am not able to start multiple appium instances.
My testng, itest listener, class file looks like:

testng.txt (1.6 KB)
retry.txt (1.7 KB)
a.txt (1.3 KB)

Anyone can help with this?

First, let create a class AppiumServer, with FreePort (it will using any free port):

public AppiumDriverLocalService appiumService() {

String appiumJSPath = “/usr/local/lib/node_modules/appium/build/lib/main.js”;
AppiumServiceBuilder builder = new AppiumServiceBuilder()
.withAppiumJS(new File(appiumJSPath))
.withArgument(GeneralServerFlag.LOG_LEVEL, “error”);
AppiumDriverLocalService appiumService =;

Log.println("[Appium] started on " + appiumService.getUrl());

return appiumService;

Second, create Driver:

driver = new IOSDriver(AppiumServer.shared().appiumService().getUrl(),capabilities);

This will help you start multiple appium with multiple port. :slight_smile: