Two Different appium driver with different devicename and platform version executes test on same device
Platform i am using is MAC and Android Debug Bridge version 1.0.32 Revision eac51f2bb6a8-android
I am starting two appium servers
server 1 using port 4723 , chrome driver port is 62362
server 2 port is 4743 , chrome driver port is 62366
and i am setting in my desirered capablities
driver1:
url = new URL("http://" 127.0.0.1:4723/wd/hub");
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "LGD8553b0c00b3");
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION,"5.0");
driver2:
url = new URL("http://"0.0.0.0:4743/wd/hub");
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "0123456789ABCDEF");
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION,"4.4.2");
i am trying to launch driver1 and driver2 in one test to verify both devices screen have same values but when i am running test 1-> driver1 is run on LG and appium server 4723 and after that when the turn for driver2 comes the test again runs on LG only with appium server 4743. even though both have different device name and platform version in desiredcapablities.
when i execute adb devices it shows both devices are connected but when i am executing it from appium, whichever device is listed first both tests are executed on it. does the devicesName parameter does not affect the execution ?
here is the log of driver2 appium server
info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)
info: Appium REST http interface listener started on 0.0.0.0:4743
info: [debug] Non-default server args: {"port":4743,"sessionOverride":true,"chromeDriverPort":62366,"defaultCommandTimeout":6000,"tmpDir":"/tmp/driver4743/"}
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"appPackage":"com.abcd","appActivity":"ui.activity.homescreens.SplashScreenActivity","platformVersion":"4.4.2","appWaitActivity":"ui.activity.homescreens.SplashScreenActivity,.ui.activity.homescreens.StartActivity,.ui.activity.RegisterFragments,.ui.activity.VideoActivity,.ui.activity.preferencesflow.PreferencesActivity,com.abcd/.ui.activity.homescreens.LargeProfilePhotoActivity,.ui.activity.DialpadActivity,.ui.activity.MoreActivity","browserName":"android","platformName":"Android","version":"","deviceName":"0123456789ABCDEF","platform":"ANDROID"}}
info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : version, platform
info: [debug] Didn't get app but did get Android package, will attempt to launch it on the device
info: [debug] Creating new appium session 01a341cc-7a51-4b54-b247-a402ba6ef64e
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_05
info: [debug] Checking whether adb is present
info: [debug] Using adb from /users/abcd/Library/Android/sdk/platform-tools/adb
warn: No app capability, can't parse package/activity
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it's already on the device
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb devices
info: [debug] 2 device(s) connected
info: Found device LGD8553b0c00b3
info: [debug] Setting device id to LGD8553b0c00b3
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 wait-for-device
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 21
info: Device API level is: 21
info: [debug] Extracting strings for language: default
info: [debug] Apk doesn't exist locally
info: [debug] Could not get strings, but it looks like we had an old strings file anyway, so ignoring
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "rm -rf /data/local/tmp/strings.json"
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Skipping install since we launched with a package instead of an app path
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device...
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 push "/usr/local/lib/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar" /data/local/tmp/
info: [debug] Pushing settings apk to device...
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 install "/usr/local/lib/node_modules/appium/build/settings_apk/settings_apk-debug.apk"
info: [debug] Pushing unlock helper app to device...
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 install "/usr/local/lib/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk"
info: Starting App
info: [debug] Attempting to kill all 'uiautomator' processes
info: [debug] Getting all processes with 'uiautomator'
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "ps 'uiautomator'"
info: [debug] Attempting to kill process 31990
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "kill 31990"
info: [debug] Running bootstrap
info: [debug] spawning: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.abcd -e disableAndroidWatchers false
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] [BOOTSTRAP] [debug] Loading json...
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] Waking up device if it's not alive
info: [debug] Pushing command to appium work queue: ["wake",{}]
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":true}
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "dumpsys window"
info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"\/data\/local\/tmp"}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":false}
info: [debug] Getting device API level
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 21
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.abcd/ui.activity.homescreens.SplashScreenActivity"
info: [debug] We tried to start an activity that doesn't exist, retrying with . prepended to activity
info: [debug] Getting device API level
info: [debug] executing cmd: /users/abcd/Library/Android/sdk/platform-tools/adb -s LGD8553b0c00b3 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 21
