Luck didn't favour for ios parallel execution with appium 1.5.3 #7674

Open
surikiran opened this Issue Jan 10, 2017 · 1 comment

Projects

None yet

2 participants

@surikiran

I have been going through lots of forums and found mixed comments saying that parallel execution of ios devices with appium is possible/impossible...but luck didn't favour as I followed all the steps provided by @saikrishna and @SrinivasanTarget but unable to succeed for not even a single instance....I am trying to execute iphone 5s(8.2) and iPad Pro(9.3.2) parallelly using appium but nothing didn't work

Environment

  • Appium 1.5.3
    Max OS X 10.11.6
    iphone 5s(8.2) and iPad Pro(9.3.2)

Details

I am going to start Appium from terminal using the command node main.js -p 4727 -bp 5786 --nodeconfig iPhone5sConfig.json and node main.js -p 4726 -bp 5785 --nodeconfig iPadProConfig.json both start successfully and register to hub but script gets executed only in iPhone 5s and fail to start in iPad Pro besides getting exception as provided below......tried with different types of parts but no change.....sometimes tried to connect iPhone 6 Plus but same exception..........tried to change the config file and json file but no change in the result......I am desperate that parallel execution is not possible to me but hope full that @saikrishna and @SrinivasanTarget along with others could help me to achieve this activity successfully

Link to Appium logs

org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'MyMachine', ip: 'MyMachineIPAddress', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_45'
Driver info: driver.version: IOSDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:665)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:36)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:114)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:132)
at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:82)
at com.mobienxV6_3.automation.execution.iOSDeviceExecution.driverCreation(iOSDeviceExecution.java:276)
at com.mobienxV6_3.automation.execution.iOSDeviceExecution.ExecutionMode(iOSDeviceExecution.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:515)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:216)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:143)
at org.testng.TestRunner.beforeRun(TestRunner.java:631)
at org.testng.TestRunner.run(TestRunner.java:599)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:368)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:402)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:4726 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'MyMachine', ip: 'MyIPAddress', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_45'
Driver info: driver.version: IOSDriver
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:84)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644)
... 30 more
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:4726 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:144)
at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:90)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69)
... 31 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
... 44 more

Code To Reproduce Issue [ Good To Have ]

I have configured my TestNG file as shown below:-

And passing the parameters of this file as shown below:-
public RemoteWebDriver driver;
capa.setCapability ( MobileCapabilityType.UDID , udid );
capa.setCapability ( MobileCapabilityType.PLATFORM_NAME , "iOS" );
capa.setCapability ( MobileCapabilityType.PLATFORM_VERSION ,
iOSVersion );
capa.setCapability ( MobileCapabilityType.APP ,
app.getAbsolutePath ( ) );
capa.setCapability ( MobileCapabilityType.DEVICE_NAME , "="
+ deviceName );
capa.setCapability ( "bundleid" , IOSReferenceVairables.appbundleId );
return ( IOSDriver < IOSElement > ) ( driver = new IOSDriver <> (
new URL ( "http://localhost:" + port + "/wd/hub" ) , capa ) );
script gets invoked successfully in iPhone 5s but fails both in iPad Pro and iPhone 6 Plus when connected them separately along with iPhone 5s............I searched all the issues from this and other forums but my success mile is not reached hence as final hope I write here and sorry if I could have not digged much into this forum.......Also want to tell that when I checked in http://appium.io/slate/en/1.5.3/?ruby#parallel-ios-tests it is strongly telling that iOS parallel execution is possible only with Sauce Labs but didn't understand how few people reached the success mile without this hence desperately I request to help me to get this issue solved

@triager triager added the NeedsTriage label Jan 10, 2017
@surikiran

Sorry forgot to add the JSON files hence adding them here
iPad Pro Config JSON
{
"capabilities": [
{
"browserName": "iPad Pro",
"version": "9.3.2",
"maxInstances": 1,
"tmp": "/Users/MyMachine/temp2/",
"platform": "MAC"
}
],
"configuration": {
"cleanUpCycle": 2000,
"timeout": 300000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url": "http://0.0.0.0:4726/wd/hub",
"host": "0.0.0.0",
"port": 4726,
"maxSession": 1,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "localhost"
}
}

iPhone5sConfig.json
{
"capabilities": [
{
"browserName": "iPhone 5s",
"version": "8.2",
"maxInstances": 1,
"tmp": "/Users/MyMachine/temp3/",
"platform": "MAC"
}
],
"configuration": {
"cleanUpCycle": 2000,
"timeout": 300000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url": "http://0.0.0.0:4727/wd/hub",
"host": "0.0.0.0",
"port": 4727,
"maxSession": 1,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "localhost"
}
}

iPhone6PlusConfig.json
{
"capabilities": [
{
"deviceName": "iPhone 6 Plus",
"version": "8.3",
"maxInstances": 5,
"tmp": "/Users/MyMachine/temp1/",
"platform": "MAC,

	}
],
"configuration": {
	"cleanUpCycle": 2000,
	"timeout": 300000,
	"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
	"url": "http://0.0.0.0:4737/wd/hub",
	"host": "0.0.0.0",
	"port": 4737,
	"maxSession": 1,
	"register": true,
	"registerCycle": 5000,
	"hubPort": 4444,
	"hubHost": "localhost"
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment