iOS [XCUITEST] real devices Parallel Execution


#1

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 here.

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)

#2

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


#3

@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.


#4

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


#5

No but you can stay in touch with appium.io or git repo.


#6

@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


#7

Appium & XCode version?


#8

@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)


#9

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.


#10

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?


#11

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


#12

@sugatmankar: How to do parallel execution in iOS 10.2 devices with Appium 1.6.3


#13

+1 for @pavanbachu query.

@sugatmankar can you please clarify wrt 10.2 iOS version

Thanks,
Vikram


#14

@VikramVI I figured it out


#15

@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


#16

@saikrishna321: Can you please provide the command that you use for starting appium session


#17

@pavanbachu i got it running in parallel they are extremely close though


#18

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.


#19

Are you using selenium grid ?!?


#20

@pavanbachu nope, i have build this framework AppiumTestDistribution which takes of parallel run