email2vimalraj / appium-stf-example

Mobile Automation using Appium on OpenSTF
http://www.vimalselvam.com/2016/08/07/appium-parallel-execution-on-openstf/
Apache License 2.0
80 stars 40 forks source link

Just get one device working #5

Open ricardo-valtierra opened 7 years ago

ricardo-valtierra commented 7 years ago

First of all thank you for this great example. I've already implemented, working with STF in a great way I've already checked my configurations , but something still seems to be wrong in this particular example

I u could give me any feedback I would greatly appreciate it. Thanks in advance.

I put the console results below:

I've been trying two ways

1) Method with real serial (not connecting the devices to adb remotely)

Method:

public Object[][] parallelDp() { return new Object[][] { {"110102d231a6924a"}, // Change the device serial {"ZY2232ZZTB"}, // Change the device serial // {"192.168.15.24:7405"}, // Change the device serial //{"192.168.15.24:7401"}, // Change the device serial }; }

Result:


[INFO] Scanning for projects... [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building appium-stf-example 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ appium-stf-example --- [INFO] Deleting /home/server/appium-stf-example/target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ appium-stf-example --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /home/server/appium-stf-example/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ appium-stf-example --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 2 source files to /home/server/appium-stf-example/target/classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ appium-stf-example --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ appium-stf-example --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 1 source file to /home/server/appium-stf-example/target/test-classes [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ appium-stf-example --- [INFO] Surefire report directory: /home/server/appium-stf-example/target/surefire-reports


T E S T S

Running com.vimalselvam.stf.AndroidTest Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@182decdb Sep 06, 2017 1:40:06 PM com.vimalselvam.DeviceApi addDeviceToUser INFO: The device <110102d231a6924a> is locked successfully [Appium] Welcome to Appium v1.6.5 [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [HTTP] --> GET /wd/hub/status {} [debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: [] [debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.6.5","revision":null}} [HTTP] <-- GET /wd/hub/status 200 57 ms - 83 [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk","platformName":"Android","udid":"110102d231a6924a","deviceName":"ANDROID"}} [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk","platformName":"Android","udid":"110102d231a6924a","deviceName":"ANDROID"},null,null] [debug] [BaseDriver] Event 'newSessionRequested' logged at 1504723210750 (13:40:10 GMT-0500 (CDT)) [Appium] Creating new AndroidDriver (v1.20.0) session [Appium] Capabilities: [Appium] app: '/home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk' [Appium] platformName: 'Android' [Appium] udid: '110102d231a6924a' [Appium] deviceName: 'ANDROID' [debug] [AndroidDriver] AndroidDriver version: 1.20.0 [BaseDriver] Session created with session id: b9e211c9-2a7e-4c2f-a38e-e797a0a917c0 [debug] [AndroidDriver] Getting Java version [AndroidDriver] Java version is: 1.8.0_144 [ADB] Checking whether adb is present [ADB] Using adb from /home/server/Android/Sdk/platform-tools/adb [AndroidDriver] Retrieving device list [debug] [ADB] Trying to find a connected android device [debug] [ADB] Getting connected devices... [debug] [ADB] 0 device(s) connected [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Getting connected devices... [debug] [ADB] 0 device(s) connected [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Getting connected devices... [debug] [ADB] 0 device(s) connected [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Getting connected devices... [debug] [ADB] 0 device(s) connected [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Getting connected devices... [debug] [ADB] 0 device(s) connected [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Getting connected devices... [debug] [ADB] 0 device(s) connected [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Getting connected devices... [debug] [ADB] 0 device(s) connected [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Getting connected devices... [debug] [ADB] 0 device(s) connected [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [ADB] Could not find devices, restarting adb server... [debug] [ADB] Restarting adb [debug] [AndroidDriver] Shutting down Android driver [debug] [AndroidDriver] Called deleteSession but bootstrap wasn't active [MJSONWP] Encountered internal error running command: Error: Could not find a connected Android device. at ADB.getDevices$ (../../../lib/tools/system-calls.js:132:13) at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21) at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17) at Promise () at F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36) at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12) at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21) at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12) at getDevices (../../../lib/tools/system-calls.js:135:18) at ADB.getDevices$ (../../../lib/tools/system-calls.js:149:20) at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21) at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) at [HTTP] <-- POST /wd/hub/session 500 25672 ms - 179 Tests run: 8, Failures: 1, Errors: 0, Skipped: 7, Time elapsed: 32.067 sec <<< FAILURE! setup(com.vimalselvam.stf.AndroidTest) Time elapsed: 31.722 sec <<< FAILURE! org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not find a connected Android device. (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 26.04 seconds Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' System info: host: 'server-VirtualBox', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-33-generic', java.version: '1.8.0_144' Driver info: io.appium.java_client.android.AndroidDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:51) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.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:47) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:114) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:132) at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:97) at com.vimalselvam.stf.AndroidTest.setup(AndroidTest.java:57)

Results :

Failed tests: setup(com.vimalselvam.stf.AndroidTest): An unknown server-side error occurred while processing the command. Original error: Could not find a connected Android device. (WARNING: The server did not provide any stacktrace information)(..)

Tests run: 8, Failures: 1, Errors: 0, Skipped: 7

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 38.655 s [INFO] Finished at: 2017-09-06T13:40:37-05:00 [INFO] Final Memory: 21M/81M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project appium-stf-example: There are test failures. [ERROR] [ERROR] Please refer to /home/server/appium-stf-example/target/surefire-reports for the individual test results. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException


This one seems to lock just one device, that appears "stop automation" on STF panel. Nothing more

2)Method with ip:port ID (connecting the devices to adb remotely first)

Method:

public Object[][] parallelDp() { return new Object[][] { //{"110102d231a6924a"}, // Change the device serial //{"ZY2232ZZTB"}, // Change the device serial {"192.168.15.24:7405"}, // Change the device serial {"192.168.15.24:7401"}, // Change the device serial }; }

Result:


[INFO] Scanning for projects... [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building appium-stf-example 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ appium-stf-example --- [INFO] Deleting /home/server/appium-stf-example/target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ appium-stf-example --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /home/server/appium-stf-example/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ appium-stf-example --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 2 source files to /home/server/appium-stf-example/target/classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ appium-stf-example --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ appium-stf-example --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 1 source file to /home/server/appium-stf-example/target/test-classes [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ appium-stf-example --- [INFO] Surefire report directory: /home/server/appium-stf-example/target/surefire-reports


T E S T S

Running com.vimalselvam.stf.AndroidTest Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@182decdb Sep 06, 2017 1:47:21 PM com.vimalselvam.DeviceApi isDeviceFound SEVERE: Device not found [Appium] Welcome to Appium v1.6.5 [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [HTTP] --> GET /wd/hub/status {} [debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: [] [debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.6.5","revision":null}} [HTTP] <-- GET /wd/hub/status 200 67 ms - 83 [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk","platformName":"Android","udid":"192.168.15.24:7405","deviceName":"ANDROID"}} [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk","platformName":"Android","udid":"192.168.15.24:7405","deviceName":"ANDROID"},null,null] [debug] [BaseDriver] Event 'newSessionRequested' logged at 1504723646262 (13:47:26 GMT-0500 (CDT)) [Appium] Creating new AndroidDriver (v1.20.0) session [Appium] Capabilities: [Appium] app: '/home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk' [Appium] platformName: 'Android' [Appium] udid: '192.168.15.24:7405' [Appium] deviceName: 'ANDROID' [debug] [AndroidDriver] AndroidDriver version: 1.20.0 [BaseDriver] Session created with session id: 6f05f22c-51d1-45c2-8e79-b0b3cf5ab381 [debug] [AndroidDriver] Getting Java version [AndroidDriver] Java version is: 1.8.0_144 [ADB] Checking whether adb is present [ADB] Using adb from /home/server/Android/Sdk/platform-tools/adb [AndroidDriver] Retrieving device list [debug] [ADB] Trying to find a connected android device [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [AndroidDriver] Using device: 192.168.15.24:7405 [ADB] Checking whether adb is present [ADB] Using adb from /home/server/Android/Sdk/platform-tools/adb [debug] [ADB] Setting device id to 192.168.15.24:7405 [BaseDriver] Using local app '/home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk' [debug] [AndroidDriver] Checking whether app is actually present [AndroidDriver] Starting Android session [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","wait-for-device"] [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","echo","ping"] [debug] [Logcat] Starting logcat capture [debug] [AndroidDriver] Pushing settings apk to device... [debug] [ADB] Getting install status for io.appium.settings [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","pm","list","packages","io.appium.settings"] [debug] [ADB] App is installed [debug] [ADB] Getting package info for io.appium.settings [debug] [ADB] Getting connected devices... [ADB] Checking whether aapt is present [ADB] Using aapt from /home/server/Android/Sdk/build-tools/26.0.1/aapt [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","dumpsys","package","io.appium.settings"] [ADB] Cannot read version codes of /usr/local/lib/node_modules/appium/node_modules/io.appium.settings/app/build/outputs/apk/settings_apk-debug.apk and/or io.appium.settings. Assuming correct app version is already installed [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","getprop","ro.build.version.sdk"] [debug] [ADB] Device API level: 23 [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","dumpsys","package","io.appium.settings"] [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","pm","dump","io.appium.settings"] [debug] [ADB] Got the following command chunks to execute: pm,grant,io.appium.settings,android.permission.WRITE_SETTINGS,;,pm,grant,io.appium.settings,android.permission.ACCESS_MOCK_LOCATION,; [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","pm","grant","io.appium.settings","android.permission.WRITE_SETTINGS",";","pm","grant","io.appium.settings","android.permission.ACCESS_MOCK_LOCATION",";"] [debug] [AndroidDriver] Pushing unlock helper app to device... [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","install","/usr/local/lib/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk"] [debug] [ADB] Device API level: 23 [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","appops","set","io.appium.settings","android:mock_location","allow"] [ADB] Getting device platform version [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","getprop","ro.build.version.release"] [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","wm","size"] [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","getprop","ro.product.model"] [debug] [ADB] Current device property 'ro.product.model': XT1563 [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","getprop","ro.product.manufacturer"] [debug] [ADB] Current device property 'ro.product.manufacturer': motorola [debug] [AndroidDriver] Parsing package and activity from app manifest [ADB] Checking whether aapt is present [ADB] Using aapt from /home/server/Android/Sdk/build-tools/26.0.1/aapt [ADB] Extracting package and launch activity from manifest [debug] [ADB] badging package: io.appium.android.apis [debug] [ADB] badging act: io.appium.android.apis.ApiDemos [debug] [AndroidDriver] Parsed package and activity are: io.appium.android.apis/io.appium.android.apis.ApiDemos [AndroidDriver] Remote apk path is /data/local/tmp/29649242b53e9a67ba855b067422713c.apk [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","ls","/data/local/tmp/29649242b53e9a67ba855b067422713c.apk"] [debug] [AndroidDriver] Checking if app is installed [debug] [ADB] Getting install status for io.appium.android.apis [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","pm","list","packages","io.appium.android.apis"] [debug] [ADB] App is installed [AndroidDriver] Apk is already on remote and installed, resetting [debug] [AndroidDriver] Running fast reset (stop and clear) [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","am","force-stop","io.appium.android.apis"] [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","pm","clear","io.appium.android.apis"] [debug] [AndroidDriver] Extracting strings from apk /home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk null /tmp/io.appium.android.apis [debug] [ADB] Extracting strings for language: default [debug] [ADB] Device API level: 23 [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","getprop","persist.sys.locale"] [debug] [ADB] Current device property 'persist.sys.locale': es-US [debug] [ADB] No strings.xml for language 'es', getting default strings.xml [debug] [ADB] Reading strings from converted strings.json [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","push","/tmp/io.appium.android.apis/strings.json","/data/local/tmp"] [debug] [AndroidBootstrap] Watching for bootstrap disconnect [debug] [ADB] Forwarding system: 4724 to device: 4724 [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","forward","tcp:4724","tcp:4724"] [debug] [UiAutomator] Starting UiAutomator [debug] [UiAutomator] Moving to state 'starting' [debug] [UiAutomator] Parsing uiautomator jar [debug] [UiAutomator] Found jar name: 'AppiumBootstrap.jar' [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","push","/usr/local/lib/node_modules/appium/node_modules/appium-android-bootstrap/bootstrap/bin/AppiumBootstrap.jar","/data/local/tmp/"] [debug] [ADB] Attempting to kill all uiautomator processes [debug] [ADB] Getting all processes with uiautomator [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","ps"] [ADB] No uiautomator process found to kill, continuing... [debug] [UiAutomator] Starting UIAutomator [debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","192.168.15.24:7405","shell","uiautomator","runtest","AppiumBootstrap.jar","-c","io.appium.android.bootstrap.Bootstrap","-e","pkg","io.appium.android.apis","-e","disableAndroidWatchers",false,"-e","acceptSslCerts",false] [debug] [UiAutomator] Moving to state 'online' [AndroidBootstrap] Android bootstrap socket is now connected [debug] [ADB] Getting connected devices... [AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers. [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","dumpsys","window"] [AndroidDriver] Screen already unlocked, doing nothing [debug] [ADB] Device API level: 23 [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","am","start","-W","-n","io.appium.android.apis/io.appium.android.apis.ApiDemos","-S","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"] [debug] [ADB] Waiting for activity matching pkg: 'io.appium.android.apis' and activity: 'io.appium.android.apis.ApiDemos' to be focused [debug] [ADB] Possible activities, to be checked: io.appium.android.apis.ApiDemos, io.appium.android.apis.io.appium.android.apis.ApiDemos [debug] [ADB] Getting focused package and activity [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","dumpsys","window","windows"] [debug] [ADB] Found package: 'io.appium.android.apis' and fully qualified activity name : 'io.appium.android.apis.ApiDemos' [Appium] New AndroidDriver session created successfully, session 6f05f22c-51d1-45c2-8e79-b0b3cf5ab381 added to master session list [debug] [BaseDriver] Event 'newSessionStarted' logged at 1504723665133 (13:47:45 GMT-0500 (CDT)) [debug] [MJSONWP] Responding to client with driver.createSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"/home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk","platformName":"Android","udid":"192.168.15.24:7405","deviceName":"ANDROID"},"app":"/home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk","platformName":"Android","udid":"192.168.15.24:7405","deviceName":"192.168.15.24:7405","deviceUDID":"192.168.15.24:7405","platformVersion":"6.0.1","deviceScreenSize":"1080x1920","deviceModel":"XT1563","deviceManufacturer":"motorola","appPackage":"io.appium.android.apis","appWaitPackage":"io.appium.android.apis","appActivity":"io.appium.android.apis.ApiDemos","appWaitActivity":"io.appium.android.apis.ApiDemos"} [HTTP] <-- POST /wd/hub/session 200 18953 ms - 924 [HTTP] --> GET /wd/hub/session/6f05f22c-51d1-45c2-8e79-b0b3cf5ab381/appium/device/current_activity {} [debug] [MJSONWP] Calling AppiumDriver.getCurrentActivity() with args: ["6f05f22c-51d1-45c2-8e79-b0b3cf5ab381"] [debug] [ADB] Getting focused package and activity [debug] [ADB] Getting connected devices... [debug] [ADB] 2 device(s) connected [debug] [ADB] Running '/home/server/Android/Sdk/platform-tools/adb' with args: ["-P",5037,"-s","192.168.15.24:7405","shell","dumpsys","window","windows"] [debug] [MJSONWP] Responding to client with driver.getCurrentActivity() result: ".ApiDemos" [HTTP] <-- GET /wd/hub/session/6f05f22c-51d1-45c2-8e79-b0b3cf5ab381/appium/device/current_activity 200 211 ms - 83 Sep 06, 2017 1:47:45 PM com.vimalselvam.DeviceApi isDeviceFound SEVERE: Device not found [HTTP] --> GET /wd/hub/status {} [debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: [] [debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.6.5","revision":null}} [HTTP] <-- GET /wd/hub/status 200 22 ms - 83 [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk","platformName":"Android","udid":"192.168.15.24:7401","deviceName":"ANDROID"}} [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk","platformName":"Android","udid":"192.168.15.24:7401","deviceName":"ANDROID"},null,null] [debug] [BaseDriver] Event 'newSessionRequested' logged at 1504723667005 (13:47:47 GMT-0500 (CDT)) [Appium] Creating new AndroidDriver (v1.20.0) session [Appium] Capabilities: [Appium] app: '/home/server/appium-stf-example/src/test/resources/ApiDemos-debug.apk' [Appium] platformName: 'Android' [Appium] udid: '192.168.15.24:7401' [Appium] deviceName: 'ANDROID' [HTTP] <-- POST /wd/hub/session 500 16 ms - 193 Tests run: 7, Failures: 1, Errors: 0, Skipped: 5, Time elapsed: 27.662 sec <<< FAILURE! setup(com.vimalselvam.stf.AndroidTest) Time elapsed: 1.818 sec <<< FAILURE! org.openqa.selenium.SessionNotCreatedException: A new session could not be created. Details: Problem getting session data for driver type AndroidDriver; does it implement 'get driverData'? (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 41 milliseconds Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' System info: host: 'server-VirtualBox', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-33-generic', java.version: '1.8.0_144' Driver info: io.appium.java_client.android.AndroidDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:51) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.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:47) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:114) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:132) at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:97) at com.vimalselvam.stf.AndroidTest.setup(AndroidTest.java:57)

Results :

Failed tests: setup(com.vimalselvam.stf.AndroidTest): A new session could not be created. Details: Problem getting session data for driver type AndroidDriver; does it implement 'get driverData'? (WARNING: The server did not provide any stacktrace information)(..)

Tests run: 7, Failures: 1, Errors: 0, Skipped: 5

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 35.210 s [INFO] Finished at: 2017-09-06T13:47:48-05:00 [INFO] Final Memory: 20M/81M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project appium-stf-example: There are test failures. [ERROR] [ERROR] Please refer to /home/server/appium-stf-example/target/surefire-reports for the individual test results. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException


In this one the devices are previously connected to adb, putting them in "stop using" before test begins This one also it begins the test on one device, opening the APP, but can't pass to the other device due to the new session problem.

Again thanks in advance!

email2vimalraj commented 6 years ago

Apologies for the delayed reply. I was busy with other things. Did you get it working now? Do you need an help?

5pac commented 5 years ago

Hey,I have encountered the same problem.Did you fix it?I need some help

imran-abbas1 commented 4 years ago

Any working solution for this problem?