This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
21 / 34
Feb 2017

Bingo ....!

With the help of WebDriverAgent Appium will be able to run test on all real iOS devices parallely.
With minor changes in WebDriverAgent ie when we launch XCUI test WebDriverAgent runner use default port 8100 for each test we are running, which will throw error that agent is already running at localhost:8100. I did minor changes in WebDriverAgent source code which can generate random no of port within range of 8100 to 8200 and deployed to Appium directory and hit appium commands with udid of devices on different terminal. Bingo all appium nodes registered to Selenium Hub and i send multiple test with UDID of each device. All test started smoothly running on all iOS which includes iOS 10 too and earlier version.

You can get customised WebDriverAgent from here281.

Prerequisite :

  • Mobile Device : iOS 10

  • XCODE version : 8

Steps to use this feature:

Make sure you can run (without errors):

  • idevicepair pair (Hit 'Trust' on device)
  • idevicepair validate
  • ios_webkit_debug_proxy --debug (just make sure this runs without error then you can ctrl+c)

Modify appium capabilities to include:

  • platformVersion: '10.0'
  • automationName: 'XCUITest'
  • realDeviceLogger: (requires you to run make after pulling down deviceconsole repo)

Hi @sugatmankar I tried running the tests but they are running really slow it is skipping the tests. Can I please know if I use your customised WebDriver Agent. Are the tests running fast or slow??

@Arun_Kumar1 Yes WDA performance is slow due to XCUITEST as compare to UIAUTOMATION which deprecated by Apple. In my customization i had only changed port no generation logic rest WDA is as it is.

We can twist WDA behavior either passing port for each device or let it generate internally for each device. I simply choose 2nd logic.

@sugatmankar Do you have any idea about when appium is going to released the fix for this other than the Beta. The official verison??

@sugatmankar

I am facing issue to run the test in ios 10.x real device. Am able to run the test successfully in simulator.
The below listed steps I followed to run the test in real device.
1.Started the appium server from terminal (server arguments are Ip,port,udid,platform,platform version)
2.Connect the desktop and device in same network
It installed and started the webdriver agent and it installed application in the device ,but it's not able to launch the app in device.

please help to overcome from this isssue

Appium & XCode version?

@sugatmankar

Please find my environment details below
1.Appium -1.6.0beta2
2.Xcode - 8.0
3.mac version - 10.11.6
4.device - iphone6(ios 10.0.1)

Have you provided below two capabilities
1. platformVersion: '10.0'
2. automationName: 'XCUITest'

If yes please provide error log you are getting on node terminal.

1 month later

Good to hear. Parallel iOS testing with appium still holds good with official Appium 1.6 release? Also we are supposed to start ios-webkit-debug-proxy for each device right! are you starting with different ports?

Yes. Obviously you need to explicitly start ios-webkit-debug-proxy with different port.

1 month later
9 days later

@sugatmankar if i provide wdaPort as caps i see the app launching parallel, but the tests run in sequence

[debug] [XCUITest] Starting iproxy to forward traffic from local port 63709 to device port 8100 over USB

When you run your tests can u see what the iproxy forward traffic port is

Hello Guys,
I mentioned for 10.X version only and please always use updated appium from its source. Rest thing about invoking parallel test is up to you ie use cucumber jvm parallel plugin or TestNG for invoking test cases, or launch one by one by changing device id manually. Hope you enjoyed working on iOS :stuck_out_tongue: always changing , its better to say always challenging if you are not aware its changes.

15 days later

@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/childprocess.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/childprocess.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?

19 days later

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?

9 days later

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)

@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

10 days later

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.

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

2 months later

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 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 !

4 months later

Hi sugatmankar,

I have installed all the dependencies of ios native app testing and have given all the capabilities correctly.My7 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.