iOS [XCUITEST] real devices Parallel Execution

@sugatmankar
Was able to start Appium instance at different port , but iproxy local port seems to 8100 for both runs. So one of the them throws error …

[XCUITest] Error: iproxy exited with code ‘208’
at SubProcess. (…/…/lib/webdriveragent.js:438:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess. (…/…/lib/teen_process.js:197:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
Error: iproxy exited with code ‘208’
at SubProcess. (…/…/lib/webdriveragent.js:438:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess. (…/…/lib/teen_process.js:197:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

@saikrishna321 : How were able to spin iproxy at port 63709 which is by default 8100… ?

Hi everyone, how’s the parallel tests running on real iOS device on the latest 1.6.4 beta version of appium? Have you guys tried?

1 Like

@alangithubtrader have tried the parallel run on 1.6.4 beta and it runs perfectly.

Can you elaborate how you architected it? Did you use ci such as Jenkins plus selenium grid? And how did you handle aggregation of all the test reports from each machine for test reporting?

Hi @alangithubtrader,

Firstly, I am suing different appium & wda port for each device (wda for iOS with XCUITest).

We are creating Master-slave pipelines for aggregation of the test reports from each machine (Jenkins)

1 Like

@sanjit1walia can you please clarify if you’re using TestNG / JUnit / Cucumber for paralleling tests ?

Any reference to blog or sample code can be useful. Thanks in advance.

@VikramVI Using cucumber for parallel tests.

Don’t have a blog yet, will create sample code and push it in my public git repo

@sanjit1walia Thanks for reply, please ping back here; once your public repo is live :slight_smile:

Hi @sugatmankar I am already configured all the things step by step but unable to launch parallel ios testing. Do you have any step by step document so that i can use as reference. Below are my Configuration.
Mac Version :- 10.12.2 MacOS Sierra
Appium :- 1.6.3
Xcode :- 8.2
iPhone6 :- 10.2.1
iPad2 :- 10.2.1
Eclipse Mars2.

Do we need to configure selenium stand alone server for parallel execution on the same machine or any other configuration needed ? If you have some document or steps of configuration it would be very helpful for me.

Thanks In Advance.

how to change port number in WDA source code?

has anyone of you actually tried the cucumber-ivm-parallel plugin?

Best practice is to use increment the WDA port number for every device

HI @sugatmankar,
I tried running from my end with appium server running programatically but it actually behaves unexpectedly as sometimes it opens the app on device and simulator but skips execution on either device. I used below code for running appium instances:

String device=REGIONAL.getProperty(object);
String[] deviceData =device.split(Constants.OBJECT_SPLIT);
AppiumDriverLocalService service;
Map<String, String> env = new HashMap<>(System.getenv());
env.put(“PATH”, “/usr/local/bin:” + env.get(“PATH”));
service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().withEnvironment(env).withIPAddress(“127.0.0.1”).usingPort(port).usingDriverExecutable(new File("/usr/local/bin/node")).withAppiumJS(new File("/usr/local/lib/node_modules/appium/build/lib/main.js")).withLogFile(new File("/Users/cex/Downloads/iOS/iOSAutomationHybridFramework/src/com/cexwebuy/logs/Application.log")));
if(device.trim().contains(deviceData[0])){//437593bb0b56b28071b0b8287b2c6844f680178c
capabilities.setCapability(CapabilityType.VERSION, CONFIG.getProperty(“version”));
capabilities.setCapability(CapabilityType.PLATFORM, CONFIG.getProperty(“platform”));
capabilities.setCapability(“deviceName”, CONFIG.getProperty(“Device”));
capabilities.setCapability(“udid”, CONFIG.getProperty(“UDID”));// 6 plus
capabilities.setCapability(“bundleId”, CONFIG.getProperty(“bundleID”));//"“com.cex.ecomiosapp”"//com.cex.cexdevinternal//com.cex.ecomapp
//capabilities.setCapability(“bundleId”, “com.cex.ecomiosapp”);
capabilities.setCapability(“automationName”, CONFIG.getProperty(“automationName”));
capabilities.setCapability(“ipa”, CONFIG.getProperty(“appName”));
capabilities.setCapability(“NoReset”, CONFIG.getProperty(“noResetVal”));
capabilities.setCapability(“realDeviceLogger”,CONFIG.getProperty(“deviceLog”));
capabilities.setCapability(“session-override”, CONFIG.getProperty(“sessionOvrdVal”));
//capabilities.setCapability(“useNewWDA”, false);
capabilities.setCapability(“wdaLocalPort”, devicePort);
//capabilities.setCapability(“startIWDP”, true);
capabilities.setCapability(“clearSystemFiles”, true);
capabilities.setCapability(“newCommandTimeout”,CONFIG.getProperty(“commandTimeOut”));
driver = new IOSDriver(service, capabilities);
}
//driver = new IOSDriver(service, capabilities);}
if(device.trim().contains(deviceData[1])){
capabilities.setCapability(CapabilityType.VERSION, CONFIG.getProperty(“version1”));
capabilities.setCapability(CapabilityType.PLATFORM, CONFIG.getProperty(“platform”));
capabilities.setCapability(“deviceName”, CONFIG.getProperty(“Device1”));
capabilities.setCapability(“udid”, CONFIG.getProperty(“UDID1”));// 6 plus
capabilities.setCapability(“bundleId”, CONFIG.getProperty(“bundleID”));//"“com.cex.ecomiosapp”"//com.cex.cexdevinternal//com.cex.ecomapp
capabilities.setCapability(“automationName”, CONFIG.getProperty(“automationName”));
capabilities.setCapability(“ipa”, CONFIG.getProperty(“appName”));
capabilities.setCapability(“NoReset”, CONFIG.getProperty(“noResetVal”));
//capabilities.setCapability(“realDeviceLogger”,CONFIG.getProperty(“deviceLog”));
capabilities.setCapability(“session-override”, CONFIG.getProperty(“sessionOvrdVal”));
capabilities.setCapability(“wdaLocalPort”, devicePort);
capabilities.setCapability(“clearSystemFiles”, true);
capabilities.setCapability(“newCommandTimeout”,CONFIG.getProperty(“commandTimeOut”));

}//service.getUrl()u//new URL("http://127.0.0.1:4723/wd/hub")
APP_LOGS.debug("Launching and Opening iOS Application");
 driver = new IOSDriver<MobileElement>(service, capabilities);	

Passing two udid’s through split function. Most of the times while running script on device throws "Error Domain=IDETestOperationsObserverErrorDomain Code=6 “Early unexpected exit, operation never finished bootstrapping - no restart will be attempted” UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted} .

My other concern is how to run appium server instances without AppiumDriverLocalService API .I meant running manually appium instances and then start the execution. currently if i start appium servers on two terminals throws error even though i customised WDA and replace with appium-xcuitest-driver folder.

Please help !

Hi sugatmankar,

I have installed all the dependencies of ios native app testing and have given all the capabilities correctly.My application launches successfully but it is showing error in hierarchy like:
“< XCUIElementTypeApplication name=“AX error -25205”>
< XCUIElementTypeWindow name=“AX error -25205”>
< XCUIElementTypeWindow name=“AX error -25205”>
< XCUIElementTypeWindow name=“AX error -25205”>”

Can you please explain the reason behind this error?

Thanks in advance.

Hi @sugatmankar
This was working so fine for me also till appium 1.22.3 but after upgrading appium from 1.22.3 to 2.0.1 I can launch everything perfectly and test get passed very smoothly but can’t run the test parrarelly ?

I have added a support thread and it is going on could you please look into it ?

Thanks in advance :slightly_smiling_face: