Not able to run multiple Appium instances parallel to test Android hybrid app in Genymotion cloud devices

Hi,

I am running the Appium test in parallel for hybrid app on Android-Genymotion cloud devices.

Running 5 Appium instances using below commands:

  1. appium -a 127.0.0.1 -p 4723 -cp 4723 -bp 5723 --chromedriver-port 6723 --session-override --udid localhost:57891

  2. appium -a 127.0.0.2 -p 4733 -cp 4733 -bp 5733 --chromedriver-port 6733 --session-override --udid localhost:57892

  3. appium -a 127.0.0.1 -p 4743 -cp 4743 -bp 5743 --chromedriver-port 6743 --session-override --udid localhost:57893

  4. appium -a 127.0.0.1 -p 4753 -cp 4753 -bp 5753 --chromedriver-port 6753 --session-override --udid localhost:57894

  5. appium -a 127.0.0.1 -p 4763 -cp 4763 -bp 5763 --chromedriver-port 6763 --session-override --udid localhost:57895
    (Or)

  6. appium -p 4723 -cp 4723 -bp 5723 --chromedriver-port 6723 --session-override --udid localhost:57891

  7. appium -p 4733 -cp 4733 -bp 5733 --chromedriver-port 6733 --session-override --udid localhost:57892

  8. appium -p 4743 -cp 4743 -bp 5743 --chromedriver-port 6743 --session-override --udid localhost:57893

  9. appium -p 4753 -cp 4753 -bp 5753 --chromedriver-port 6753 --session-override --udid localhost:57894

  10. appium -p 4763 -cp 4733 -bp 5763 --chromedriver-port 6763 --session-override --udid localhost:57895

After launching the capabilities few Appium instances are stopping and showing below Msg
“adb.exe’ with args: [”-P",5037,"-s",“localhost:58971”,“shell”,“am”,“force-stop”
“io.appium.unlock”] [debug] [AndroidDriver] App was not copied, so not deleting"

Software versions used:
Appium Server-v1.7.1
Android SDK -API21,26 and 27
Android Debug Bridge version 1.0.39

PFB attached screenshot for more details:
Sorry if anythings is not clear.Will send you the completed Appium logs tomorrow.
Thanks in Advance.

PFB Server Logs:

[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION
=LoginBtn, INSTANCE=0]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Cle
aring Accessibility cache and retrying.
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘LoginBtn’ using ‘ID’
with the contextId: ‘’ multiple: false
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=com.inquesttechnologies.iqmobile:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=android:id/LoginBtn]
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION
=LoginBtn, INSTANCE=0]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:7
,“value”:“No element found”}
[HTTP] <-- POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/element 500
483 ms - 164
[HTTP] --> GET /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/context {}
[debug] [MJSONWP] Calling AppiumDriver.getCurrentContext() with args: [“2d4d6496
-d208-4825-8235-e68bcf48d00c”]
[debug] [MJSONWP] Responding to client with driver.getCurrentContext() result: "
NATIVE_APP"
[HTTP] <-- GET /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/context 200
3 ms - 84
[HTTP] --> POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/element {“u
sing”:“id”,“value”:“LoginBtn”}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“id”,“LoginBtn”
,“2d4d6496-d208-4825-8235-e68bcf48d00c”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class
name, accessibility id, -android uiautomator
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class
name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:
“find”,“params”:{“strategy”:“id”,“selector”:“LoginBtn”,“context”:"",“multiple”:f
alse}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:
“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“LoginBtn”,“contex
t”:"",“multiple”:false}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘LoginBtn’ using ‘ID’
with the contextId: ‘’ multiple: false
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=com.inquesttechnologies.iqmobile:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=android:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION
=LoginBtn, INSTANCE=0]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Cle
aring Accessibility cache and retrying.
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘LoginBtn’ using ‘ID’
with the contextId: ‘’ multiple: false
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=com.inquesttechnologies.iqmobile:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=android:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION
=LoginBtn, INSTANCE=0]
[debug] [AndroidBootstrap] Received command result from bootstrap
[HTTP] <-- POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/element 500
472 ms - 164
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:7
,“value”:“No element found”}
[HTTP] --> GET /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/context {}
[debug] [MJSONWP] Calling AppiumDriver.getCurrentContext() with args: [“2d4d6496
-d208-4825-8235-e68bcf48d00c”]
[debug] [MJSONWP] Responding to client with driver.getCurrentContext() result: "
NATIVE_APP"
[HTTP] <-- GET /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/context 200
3 ms - 84
[HTTP] --> POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/element {“u
sing”:“id”,“value”:“LoginBtn”}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“id”,“LoginBtn”
,“2d4d6496-d208-4825-8235-e68bcf48d00c”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class
name, accessibility id, -android uiautomator
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class
name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:
“find”,“params”:{“strategy”:“id”,“selector”:“LoginBtn”,“context”:"",“multiple”:f
alse}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:
“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“LoginBtn”,“contex
t”:"",“multiple”:false}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘LoginBtn’ using ‘ID’
with the contextId: ‘’ multiple: false
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=com.inquesttechnologies.iqmobile:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=android:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION
=LoginBtn, INSTANCE=0]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Cle
aring Accessibility cache and retrying.
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘LoginBtn’ using ‘ID’
with the contextId: ‘’ multiple: false
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=com.inquesttechnologies.iqmobile:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=android:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION
=LoginBtn, INSTANCE=0]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:7
,“value”:“No element found”}
[debug] [AndroidBootstrap] Received command result from bootstrap
[HTTP] <-- POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/element 500
505 ms - 164
[HTTP] --> GET /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/context {}
[debug] [MJSONWP] Calling AppiumDriver.getCurrentContext() with args: [“2d4d6496
-d208-4825-8235-e68bcf48d00c”]
[debug] [MJSONWP] Responding to client with driver.getCurrentContext() result: "
NATIVE_APP"
[HTTP] <-- GET /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/context 200
3 ms - 84
[HTTP] --> POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/element {“u
sing”:“id”,“value”:“LoginBtn”}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“id”,“LoginBtn”
,“2d4d6496-d208-4825-8235-e68bcf48d00c”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class
name, accessibility id, -android uiautomator
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class
name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:
“find”,“params”:{“strategy”:“id”,“selector”:“LoginBtn”,“context”:"",“multiple”:f
alse}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:
“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“LoginBtn”,“contex
t”:"",“multiple”:false}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘LoginBtn’ using ‘ID’
with the contextId: ‘’ multiple: false
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=com.inquesttechnologies.iqmobile:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=android:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION
=LoginBtn, INSTANCE=0]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Cle
aring Accessibility cache and retrying.
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘LoginBtn’ using ‘ID’
with the contextId: ‘’ multiple: false
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=com.inquesttechnologies.iqmobile:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=android:id/LoginBtn]
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION
=LoginBtn, INSTANCE=0]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:7
,“value”:“No element found”}
[HTTP] <-- POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/element 500
493 ms - 164
[HTTP] --> GET /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/context {}
[debug] [MJSONWP] Calling AppiumDriver.getCurrentContext() with args: [“2d4d6496
-d208-4825-8235-e68bcf48d00c”]
[debug] [MJSONWP] Responding to client with driver.getCurrentContext() result: "
NATIVE_APP"
[HTTP] <-- GET /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/context 200
3 ms - 84
[HTTP] --> POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/element {“u
sing”:“id”,“value”:“LoginBtn”}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: [“id”,“LoginBtn”
,“2d4d6496-d208-4825-8235-e68bcf48d00c”]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class
name, accessibility id, -android uiautomator
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class
name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:
“find”,“params”:{“strategy”:“id”,“selector”:“LoginBtn”,“context”:"",“multiple”:f
alse}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:
“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“LoginBtn”,“contex
t”:"",“multiple”:false}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘LoginBtn’ using ‘ID’
with the contextId: ‘’ multiple: false
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=com.inquesttechnologies.iqmobile:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=android:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION
=LoginBtn, INSTANCE=0]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Cle
aring Accessibility cache and retrying.
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘LoginBtn’ using ‘ID’
with the contextId: ‘’ multiple: false
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=com.inquesttechnologies.iqmobile:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=android:id/LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0,
RESOURCE_ID=LoginBtn]
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[DESCRIPTION
=LoginBtn, INSTANCE=0]
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:7
,“value”:“No element found”}
[HTTP] <-- POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/element 500
495 ms - 164
[HTTP] --> POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/timeouts {"
type":“implicit”,“ms”:5000}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: [“implicit”,5000,“2
d4d6496-d208-4825-8235-e68bcf48d00c”]
[debug] [BaseDriver] Set implicit wait to 5000ms
[debug] [MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/timeouts 20
0 3 ms - 76
[BaseDriver] Shutting down because we waited 60 seconds for a command
[debug] [AndroidDriver] Shutting down Android driver
[Appium] Closing session, cause was ‘New Command Timeout of 60 seconds expired.
Try customizing the timeout using the ‘newCommandTimeout’ desired capability’
[Appium] Removing session 2d4d6496-d208-4825-8235-e68bcf48d00c from our master s
ession list
[debug] [ADB] Getting connected devices…
[HTTP] --> POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/timeouts {"
type":“implicit”,“ms”:0}
[HTTP] <-- POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/timeouts 40
4 3 ms - 131
[HTTP] --> POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/timeouts {"
type":“implicit”,“ms”:5000}
[HTTP] <-- POST /wd/hub/session/2d4d6496-d208-4825-8235-e68bcf48d00c/timeouts 40
4 4 ms - 131
[debug] [ADB] 3 device(s) connected
[debug] [ADB] Running ‘C:\Users\bmadhu\AppData\Local\Android\sdk\platform-tools
adb.exe’ with args: ["-P",5037,"-s",“localhost:57600”,“shell”,“am”,“force-stop”,
“com.inquesttechnologies.iqmobile”]
[debug] [ADB] Pressing the HOME button
[debug] [ADB] Getting connected devices…
[debug] [ADB] 3 device(s) connected
[debug] [ADB] Running ‘C:\Users\bmadhu\AppData\Local\Android\sdk\platform-tools
adb.exe’ with args: ["-P",5037,"-s",“localhost:57600”,“shell”,“input”,“keyevent”
,3]
[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“shutdown”}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [UiAutomator] Shutting down UiAutomator
[debug] [UiAutomator] Moving to state ‘stopping’
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:
“shutdown”}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0
,“value”:“OK, shutting down”}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomato
rTestRunner
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunS
erver
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appi
um.android.bootstrap.Bootstrap
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=
[debug] [AndroidBootstrap] [UIAUTO STDOUT] Test results for WatcherResultPrinter
=.
[debug] [AndroidBootstrap] [UIAUTO STDOUT] Time: 189.492
[debug] [AndroidBootstrap] [UIAUTO STDOUT] OK (1 test)
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: -1
[debug] [UiAutomator] UiAutomator shut down normally
[debug] [UiAutomator] Moving to state ‘stopped’
[debug] [ADB] Attempting to kill all uiautomator processes
[debug] [ADB] Getting all processes with uiautomator
[debug] [ADB] Getting connected devices…
[debug] [ADB] 3 device(s) connected
[debug] [ADB] Running ‘C:\Users\bmadhu\AppData\Local\Android\sdk\platform-tools
adb.exe’ with args: ["-P",5037,"-s",“localhost:57600”,“shell”,“ps”]
[ADB] No uiautomator process found to kill, continuing…
[debug] [UiAutomator] Moving to state ‘stopped’
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Getting connected devices…
[debug] [ADB] 3 device(s) connected
[debug] [ADB] Running ‘C:\Users\bmadhu\AppData\Local\Android\sdk\platform-tools
adb.exe’ with args: ["-P",5037,"-s",“localhost:57600”,“shell”,“am”,“force-stop”,
“io.appium.unlock”]
[debug] [AndroidDriver] App was not copied, so not deleting

PFA Sample code Sample Code.txt (8.2 KB)

Hello All,
Please help on Parallel test execution: Android App (more than 5 Appium instances).

Step 1: *********************** Appium Instances ************************************************
start appium -p 4723 -bp 2723 --chromedriver-port 1723 --session-override --udid localhost:65113 --log E:/AppiumLogs/Appium1.log --log-timestamp
start appium -p 4733 -bp 2733 --chromedriver-port 1733 --session-override --udid localhost:65095 --log E:/AppiumLogs/Appium2.log --log-timestamp
start appium -p 4743 -bp 2743 --chromedriver-port 1743 --session-override --udid localhost:65077 --log E:/AppiumLogs/Appium3.log --log-timestamp
start appium -p 4753 -bp 2753 --chromedriver-port 1753 --session-override --udid localhost:65057 --log E:/AppiumLogs/Appium4.log --log-timestamp
start appium -p 4763 -bp 2763 --chromedriver-port 1763 --session-override --udid localhost:65039 --log E:/AppiumLogs/Appium5.log --log-timestamp
start appium -p 4773 -bp 2773 --chromedriver-port 1773 --session-override --udid localhost:65015 --log E:/AppiumLogs/Appium6.log --log-timestamp

Step2: Suite File****************************

<?xml version="1.0" encoding="UTF-8"?>

**(Genymotion will assign device automatically)**
 </classes>
<classes>				
  	<class name="com.smartapp.mobile.testcases.VerifyZoneInitialization"/>              
 	
 </classes>
<parameter name="appiumDriverPort" value="4763"/>	
<parameter name="deviceName" value="genymotion"/>	
		
<classes>				
  	<class name="com.smartapp.mobile.testcases.VerifyZoneInitialization"/>               
 
 </classes>
<classes>				
  	<class name="com.smartapp.mobile.testcases.VerifyZoneInitialization"/>            
 
 </classes>

Step3: Test Script**************************

public class VerifyZoneInitialization{

private AppiumDriver<WebElement> driver;	
private WebDriverWait wait;
DesiredCapabilities capabilities;
TouchAction touchAction;	
NativeViewPage nativeViewPage;

String usrName ="";
String usrPwd ="";
String zoneName ="";

@Factory(dataProviderClass=DataProvidersRepo.class,dataProvider="userLoginData")
public VerifyZoneInitialization(String usrName,String usrPwd, String zoneName) {
    this.usrName = usrName;
    this.usrPwd = usrPwd;
    this.zoneName = zoneName;
}
@Parameters({ "appiumDriverPort","deviceName" })
@BeforeTest(alwaysRun=true)
public void driverSetup(String driverUrl,String device) throws MalformedURLException, Exception {		
	System.out.println("@BeforeTest:Test is executing via Thread Id:"+Thread.currentThread().getId());
	capabilities = new DesiredCapabilities();	    
	capabilities.setCapability("platformName","ANDROID" );
	capabilities.setCapability("automationName","UiAutomator2");
	capabilities.setCapability("deviceName",device);				
	capabilities.setCapability("noReset", false);	
	capabilities.setCapability("autoGrantPermissions", true);	
	capabilities.setCapability("clearSystemFiles", true);								
	capabilities.setCapability("autoWebviewTimeout", 40000);		
	capabilities.setCapability("newCommandTimeout", 120);
	capabilities.setCapability("nativeWebScreenshot", true);			
	capabilities.setCapability("appPackage","com.XXXXXXX.iqmobile");
	capabilities.setCapability("appWaitPackage","com.XXXXXXX.iqmobile");
	//capabilities.setCapability("appActivity", "com.XXXXX.XXXXX.SplashActivity"); 
	capabilities.setCapability("appActivity", "com.XXXXXXXXXXX.IQMobile");  
	capabilities.setCapability("appWaitActivity", "com.XXXXXXX.iqmobile.IQMobile");
	driver = new AndroidDriver<WebElement>(new URL("http://localhost:"+driverUrl+"/wd/hub"), capabilities);
	driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
	driver.getPageSource();	
		
}
@BeforeClass
public void intializeObjects() {

	nativeViewPage = new NativeViewPage(driver);
	wait = new WebDriverWait(driver,90);
	touchAction = new TouchAction(driver);	
}
@Test(alwaysRun=true)
public void conedFuseZoneInitialization() throws Exception {				
			
  	System.out.println("TestData:"+usrName+"--"+usrPwd+"--"+zoneName);	  	
  	driver.context("NATIVE_APP");	  	
	Thread.sleep(3000);		
	nativeViewPage.nativeModeLogin(usrName, usrPwd);		
	nativeViewPage.loginButton.click();
	
	try {
		pageSourceReload();		
		wait.until(ExpectedConditions.visibilityOf(nativeViewPage.logoutButton));
	}catch(Exception e) {}						

	nativeViewPage.selectAppZone(zoneName);
	Thread.sleep(5000);
	try {
		  wait.until(ExpectedConditions.invisibilityOf(nativeViewPage.appsLoadIntialProgressBar));
	 }catch(Exception e) {}
	boolean isLoadingPercentageDisplayed =true;  
	while(isLoadingPercentageDisplayed) {
		try {
			nativeViewPage.appsLoadingPerentage.isDisplayed();			          
							
		}	
		catch(Exception e) {
			isLoadingPercentageDisplayed = false;	
			driver.getPageSource();	
			try {
				Assert.assertTrue(nativeViewPage.appsLoadingAlertImg.isDisplayed());
				touchAction.tap(nativeViewPage.zoneRetryYesButton);										
			}catch(Exception e1){}

		}
	}			
	Assert.assertTrue(nativeViewPage.zoneCentralBackButton.isDisplayed());		
	touchAction.tap(nativeViewPage.zoneCentralBackButton);
	Thread.sleep(5000);
	
}

@AfterMethod(alwaysRun=true)
public void captureScreenShot(ITestResult result) {
	 
	/Take screenshot if it fail & reset the app 
	
	driver.resetApp();
	driver.getCapabilities(); //To come back to login screen
}
@AfterTest
public void tearDown() {
	if(driver!=null) {
		driver.quit();
	}
	
}

It will be helpful to provide little guidance.

Thanks,
Madhu