I am trying to automate webapps on Android devices using appium.
Configuration:
Appium:V1.3.7
Android version 5.0
Code :AndroidDriver dr;
WebDriverWait myWaitVar;
DesiredCapabilities capa = new DesiredCapabilities();
capa.setCapability("deviceName", "Android");
capa.setCapability("browserName", "Chrome");
capa.setCapability("platformName", "Android");
capa.setCapability("platformVersion", "5.0");
try {
dr = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capa);
System.out.println("in the session");
dr.get("www.google.com");
}
catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Error :
info: [debug] Responding to client with error: {āstatusā:33,āvalueā:{āmessageā:āA new session could not be created. (Original error: connect ECONNREFUSED)ā,ācodeā:āECONNREFUSEDā,āerrnoā:āECONNREFUSEDā,āsyscallā:āconnectā,āorigValueā:āconnect ECONNREFUSEDā},āsessionIdā:null}
Attaching Appium logs with this post.
Please helplogs.txt (7.6 KB)
I believe the problem is not happening with "you just cannot reach āhttp://127.0.0.1:4723ā, "ā¦ because the log (attached below by AppiumUser) is clearly shown that it is running on the same port , You just check with your Url.
Please make sure that your Url should be starts with http protocol -> dr.get(āwww.google.comā); should be dr.get(āhttps://www.google.co.in/ā);, The Appium Remote Url if fine with pot num 4723. and make change ādeviceNameā as your deviceās Name displayed in settings (if possible, if not then no problem).
Please have a try, hope will helps to resolve and let me know the result.
Thanks for the reply. I tried changing URL.Also have mentioned path of chromedriver.exe in the system variable PATH. Still the issue is occuring. logs with this post attached.logs_06042015.txt (7.9 KB)
If you are able to do some debugging, the place to look is under node_modules/appium-chromedriver/lib/chromedriver.js line 58. Try to figure out whay th spawn fails.
Hi Bhaskar,
I am now getting different logs.
Recentaly i upgraded Appium to 1.4.0 .
but still no success.
Starting Node Server
warn: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future version. Please upgrade!
info: Welcome to Appium v1.4.0 (REV 8f63e2f91ef7907aed8bda763f4e5ca08e86970a)
info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {āaddressā:ā127.0.0.1ā,ānoResetā:true,ālogNoColorsā:true,āplatformNameā:āAndroidā,āplatformVersionā:ā18ā,āautomationNameā:āAppiumā}
info: Console LogLevel: debug
info: ā POST /wd/hub/session {ādesiredCapabilitiesā:{āplatformVersionā:ā5.0ā,āplatformNameā:āAndroidā,ādeviceNameā:āAndroidā,ābrowserNameā:āchromeā,āudidā:ā4d00c1e65bb9a0c1ā}}
info: Client User-Agent string: Apache-HttpClient/4.3.2 (java 1.5)
info: Set mode: Proxying straight through to Chromedriver
info: [debug] Looks like we want chrome on android
info: [debug] Creating new appium session 564c0e7d-c307-4230-8797-dfe82e1603ac
info: [debug] Checking whether adb is present
info: [debug] Using adb from D:\android-sdks\platform-tools\adb.exe
info: [debug] Using fast reset? false
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: D:\android-sdks\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device 4d00c1e65bb9a0c1
info: [debug] Setting device id to 4d00c1e65bb9a0c1
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: D:\android-sdks\platform-tools\adb.exe -s 4d00c1e65bb9a0c1 wait-for-device
info: [debug] executing cmd: D:\android-sdks\platform-tools\adb.exe -s 4d00c1e65bb9a0c1 shell āecho āreadyāā
info: [debug] Starting logcat capture
info: [debug] Set chromedriver binary as: C:\Program Files\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
info: Set chromedriver binary as: C:\Program Files\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
info: [debug] Pushing unlock helper app to deviceā¦
info: [debug] executing cmd: D:\android-sdks\platform-tools\adb.exe -s 4d00c1e65bb9a0c1 install āC:\Program Files\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apkā
info: [debug] executing cmd: D:\android-sdks\platform-tools\adb.exe -s 4d00c1e65bb9a0c1 shell ādumpsys windowā
info: [debug] Screen already unlocked, continuing.
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: D:\android-sdks\platform-tools\adb.exe -s 4d00c1e65bb9a0c1 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to deviceā¦
info: [debug] executing cmd: D:\android-sdks\platform-tools\adb.exe -s 4d00c1e65bb9a0c1 push āC:\Program Files\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jarā /data/local/tmp/
info: Starting App
info: [debug] Attempting to kill all āuiautomatorā processes
info: [debug] Getting all processes with āuiautomatorā
info: [debug] executing cmd: D:\android-sdks\platform-tools\adb.exe -s 4d00c1e65bb9a0c1 shell āps āuiautomatorāā
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: D:\android-sdks\platform-tools\adb.exe -s 4d00c1e65bb9a0c1 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.android.chrome -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] Pushing command to appium work queue: [āgetDataDirā,{}]
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] [BOOTSTRAP] [debug] Client connected
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: Killing any old chromedrivers, running: FOR /F āusebackq tokens=5ā %a in (netstat -nao ^| findstr /R /C:"9515 ") do (FOR /F āusebackqā %b in (TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe) do (IF NOT %b==āā TASKKILL /F /PID %a))
info: No old chromedrivers seemed to exist
info: Spawning chromedriver with: C:\Program Files\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe --url-base=wd/hub --port=9515
info: [CHROMEDRIVER STDOUT] Starting ChromeDriver 2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3) on port 9515
Only local connections are allowed.
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Could not proxy command to remote server. Original error: connect ECONNREFUSED
info: [debug] Error: Could not proxy command to remote server. Original error: connect ECONNREFUSED
at JWProxy.proxy$ (lib/proxy.js:121:13)
at tryCatch (C:\Program Files\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Program Files\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\babel-runtime\regenerator\runtime.js:231:22)
at GeneratorFunctionPrototype.Gp.(anonymous function) [as throw] (C:\Program Files\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\babel-runtime\regenerator\runtime.js:264:19)
at tryCatch (C:\Program Files\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.step (C:\Program Files\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\babel-runtime\regenerator\runtime.js:116:22)
at lib$es6$promise$$internal$$tryCatch (C:\Program Files\Appium\node_modules\appium\node_modules\es6-promise\dist\es6-promise.js:319:16)
at lib$es6$promise$$internal$$invokeCallback (C:\Program Files\Appium\node_modules\appium\node_modules\es6-promise\dist\es6-promise.js:331:17)
at lib$es6$promise$$internal$$publish (C:\Program Files\Appium\node_modules\appium\node_modules\es6-promise\dist\es6-promise.js:302:11)
at lib$es6$promise$$internal$$publishRejection (C:\Program Files\Appium\node_modules\appium\node_modules\es6-promise\dist\es6-promise.js:252:7)
at Object.lib$es6$promise$asap$$flush [as _onImmediate] (C:\Program Files\Appium\node_modules\appium\node_modules\es6-promise\dist\es6-promise.js:113:9)
at processImmediate [as _immediateCallback] (timers.js:330:15)
info: [debug] Responding to client with error: {āstatusā:33,āvalueā:{āmessageā:āA new session could not be created. (Original error: Could not proxy command to remote server. Original error: connect ECONNREFUSED)ā,āorigValueā:āCould not proxy command to remote server. Original error: connect ECONNREFUSEDā},āsessionIdā:null}
info: ā POST /wd/hub/session 500 27770.448 ms - 278
No it dint help. Same logs. I just wonder about the line from code
Looks like we want chrome on android ā¦ does this mean i dont have Chrome on my device ?
HI,
Noā¦it is saying about currently doing Web App automation on Chromeā¦Thats it.(if you are automating Hybrid App it will show app required or something elseā¦) .Nothing is wrong with thatā¦!!!
And iām also getting the below warning when i was upgraded to latest appium version
** " Starting Node Server
warn: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future version. Please upgrade! " **
I guess the problem with your chrome browser version (Iām not sure).Please check with others tooā¦
Regards,
Bhaskar.
@ Bhaskar
Iām also facing the same issue with node < 0.12 and upgrade it. Please let me know how u have updated the node to its latest version and how you re-installed the appiumā¦thanks in advance please help me out
Error as follows :
" > warn: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future version. Please upgrade! "
" error: No app set; either start appium with --app or pass in an āappā value in desired capabilities, or set androidPackage to launch pre-existing app on device "