java - Appium test launch fails on multiple devices -


i working on windows 7 machine , trying implement appium test launch on 2 real android devices parallel. able launch on each of 2 devices separately , test executed expected simultaneous launch using junit fails following stacktrace 1 of devices:

info: [debug] pushing command appium work queue: ["element:gettext",{"elementid":"2"}] info: [debug] [bootstrap] [debug] got data client: {"cmd":"action","action":"element:gettext","params":{"elementid":"2"}} info: [debug] [bootstrap] [debug] got command of type action info: [debug] [bootstrap] [debug] got command action: gettext info: [debug] [bootstrap] [debug] returning result: {"value":"sign up","status":0} info: [debug] responding client success: {"status":0,"value":"sign up","sessionid":"c730d16f-ca7f-42aa-be23-da33bbefd9f0"} info: <-- /wd/hub/session/c730d16f-ca7f-42aa-be23-da33bbefd9f0/element/2/text 200 56.413 ms - 81 {"status":0,"value":"sign up","sessionid":"c730d16f-ca7f-42aa-be23-da33bbefd9f0"} info: --> delete /wd/hub/session/c730d16f-ca7f-42aa-be23-da33bbefd9f0 {} info: shutting down appium session info: [debug] pressing home button info: [debug] executing cmd: c:\users\kristaps.mezavilks\appdata\local\android\sdk\platform-tools\adb.exe -s 192.168.1.204:5555 shell "input keyevent 3" info: [debug] stopping logcat capture info: [debug] logcat terminated code null, signal sigterm info: [debug] [bootstrap] [debug] got data client: {"cmd":"shutdown"} info: [debug] [bootstrap] [debug] got command of type shutdown info: [debug] [bootstrap] [debug] returning result: {"value":"ok, shutting down","status":0} info: [debug] [bootstrap] [debug] closed client connection info: [debug] [uiautomator stdout] instrumentation_status: numtests=1 info: [debug] [uiautomator stdout] instrumentation_status: stream=. 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: 0 info: [debug] [uiautomator stdout] instrumentation_status: stream= info: [debug] [uiautomator stdout] test results watcherresultprinter=. info: [debug] [uiautomator stdout] time: 6.985 info: [debug] [uiautomator stdout] ok (1 test) info: [debug] [uiautomator stdout] instrumentation_status_code: -1 info: [debug] sent shutdown command, waiting uiautomator stop... info: [debug] uiautomator shut down info: [debug] cleaning android objects info: [debug] cleaning appium session info: [debug] responding client success: {"status":0,"value":null,"sessionid":"c730d16f-ca7f-42aa-be23-da33bbefd9f0"} 

before launch perform following actions:

  • launch selenium grid:
    java -jar selenium-server-standalone-2.46.0.jar -role -hub -throwoncapabilitynotpresent
  • launch 2 appium nodes:
    node appium --nodeconfig c:\users\kristaps.mezavilks\selenium\node_p.json -p 4728 --udid 192.168.219:5555
    and
    node appium --nodeconfig c:\users\kristaps.mezavilks\selenium\node_c.json -p 4730 --udid 192.168.204:5555

example of config file node_c.json:

{    "capabilities":[       {          "browsername":"android",          "version":"4.4.2",          "maxinstances":3,          "platform":"android",          "devicename":"192.168.1.204:5555"       }    ],    "configuration":{       "cleanupcycle":2000,       "timeout":30000,       "proxy":"org.openqa.grid.selenium.proxy.defaultremoteproxy",       "url":"http://localhost:4730/wd/hub",       "host":"localhost",       "port":4730,       "maxsession":1,       "register":true,       "registercycle":5000,       "hubport":4444,       "hubhost":"192.168.1.216"    } } 

getting android driver:

static androiddriver get() {         desiredcapabilities capabilities = new desiredcapabilities();         capabilities.setplatform(platform.android)         capabilities.setbrowsername("")         capabilities.setversion(mobileversion)         capabilities.setcapability(mobilecapabilitytype.device_name, deviceid);         capabilities.setcapability(mobilecapabilitytype.app, apppath);         capabilities.setcapability(mobilecapabilitytype.udid, deviceid)         def url remoteaddress = new url("http://localhost:4444/wd/hub")         new androiddriver(remoteaddress, capabilities)     } 

do have idea problem or @ least point me in right direction problem? many thanks.

edit: after @ageoffan suggestion fixed first problem there connection reset problem:

info: [debug] [uiautomator stdout] instrumentation_status: current=1 info: [debug] [uiautomator stdout] instrumentation_status: id=uiautomatortestrunner info: [debug] [uiautomator stdout] instrumentation_status: class=io.appium.android.bootstrap.bootstrap info: [debug] [uiautomator stdout] instrumentation_status: stream= info: [debug] [uiautomator stdout] io.appium.android.bootstrap.bootstrap: info: [debug] [uiautomator stdout] instrumentation_status: numtests=1 info: [debug] [uiautomator stdout] instrumentation_status: test=testrunserver 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] waking device if it's not alive info: [debug] pushing command appium work queue: ["wake",{}] info: [debug] [bootstrap] [debug] json loading complete. info: [debug] [bootstrap] [debug] registered crash watchers. error: unhandled error: error: read econnreset     @ exports._errnoexception (util.js:746:11)     @ tcp.onread (net.js:559:26) context: [post /wd/hub/session {"desiredcapabilities":{"app":"c:\\users\\kristaps.mezavilks\\workspace\\android-app\\project\\build\\outputs\\apk\\project-debug2.apk","browsername":"","udid":"192.168.1.219:5555","platformname":"android] 

i dealing problem on week focused on following stacktrace line info: [debug] [bootstrap] [debug] socket opened on port 4724 , figured out instances connect same socket port (all tcp forwarding commands equal instances).

so after while managed find way define forwarding on custom ports using bootstrap port parameter -bp <post_number> added node command. after had set custom ports able launch simultaneous parallel tests on 4 devices in real time.

thanks @ageoffan help!


Comments