How to use selendroid with appium -


i have java maven project runs test of native app in real device using appium. trying use selendroid appium. set capability automationname selendroid , set selendroid port 8080 in appium. app getting launched click or tap not working. need set more. below error appium , code

> starting node server > info: welcome appium v1.2.0 (rev e53f49c706a25242e66d36685c268b599cc18da5) > debug: non-default server args:                                                                                                       {"address":"127.0.0.1","lognocolors":true,"platformname":"android","platformversion":"18","automation    name":"selendroid"} > info: appium rest http interface listener started on 127.0.0.1:4723 > info: loglevel: debug > info: --> post /wd/hub/session {"desiredcapabilities":       {"app":"c:\\users\\antony\\workspace\\appiumjustwink\\app\\justwink-usa-    2.3.2.218221.69.apk","apppackage":"com.justwink","autowebviewtimeout":6000,"appwaitpackage":"com.just   wink","appwaitactivity":"com.justwink.splashscreen.splashactivity","devicename":"sch-        i535","autolaunch":"true","appactivity":"com.justwink.splashscreen.splashactivity","newcommandtimeout        ":24000,"platformversion":"4.4","automationname":"selendroid","browsername":"","autowebview":true,"  platformname":"android"}} > debug: appium request initiated @ /wd/hub/session > debug: request received params: {"desiredcapabilities":     {"app":"c:\\users\\antony\\workspace\\appiumjustwink\\app\\justwink-usa-    2.3.2.218221.69.apk","apppackage":"com.justwink","autowebviewtimeout":6000,"appwaitpackage":"com.just   wink","appwaitactivity":"com.justwink.splashscreen.splashactivity","devicename":"sch-     i535","autolaunch":"true","appactivity":"com.justwink.splashscreen.splashactivity","newcommandtimeout ":24000,"platformversion":"4.4","automationname":"selendroid","browsername":"","autowebview":true,"pl atformname":"android"}}  > debug: following desired capabilities provided, not recognized appium.      passed on other services running on server. : autolaunch > debug: using local app desired caps: c:\users\antony\workspace\appiumjustwink\app\justwink- usa-2.3.2.218221.69.apk > info: retrieving device > debug: creating new appium session ff684895-7955-499a-b298-f56ee81ee5f4 > debug: starting selendroid server > debug: checking whether selendroid built yet > debug: selendroid server exists! > debug: preparing device session > debug: checking whether app present > debug: checking whether adb present > debug: using adb c:\androidsdk\sdk\platform-tools\adb.exe > debug: trying find connected android device > debug: getting connected devices... > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" devices > debug: 1 device(s) connected > info: found device 43013dce > debug: setting device id 43013dce > debug: waiting device ready , respond shell commands (timeout = 5) > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce wait-for-device > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce shell "echo 'ready'" > debug: starting logcat capture > debug: rebuilt selendroid apk exists, doing nothing > debug: rebuilt selendroid server exists, no need rebuild new manifest > debug: checking signed status of c:\windows\temp\selendroid.com.justwink.apk > debug: checking app cert c:\windows\temp\selendroid.com.justwink.apk: java -jar "c:\program   files (x86)\appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar" "c:\windows\temp\selendroid.com.justwink.apk" > debug: checking signed status of c:\users\antony\workspace\appiumjustwink\app\justwink-usa-2.3.2.218221.69.apk > debug: checking app cert c:\users\antony\workspace\appiumjustwink\app\justwink-usa-   2.3.2.218221.69.apk: java -jar "c:\program files  (x86)\appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar"  "c:\users\antony\workspace\appiumjustwink\app\justwink-usa-2.3.2.218221.69.apk" > debug: app signed. > debug: zip-aligning c:\windows\temp\selendroid.com.justwink.apk > debug: checking whether zipalign present > debug: using zipalign c:\androidsdk\sdk\build-tools\19.1.0\zipalign.exe > debug: zipalignapk: "c:\androidsdk\sdk\build-tools\19.1.0\zipalign.exe" -f 4 "c:\windows\temp\selendroid.com.justwink.apk" "c:\users\antony\appdata\local\temp\appium114824-5500-v7yco6.tmp" > debug: app signed. > debug: zip-aligning c:\users\antony\workspace\appiumjustwink\app\justwink-usa-2.3.2.218221.69.apk > debug: checking whether zipalign present > debug: using zipalign c:\androidsdk\sdk\build-tools\19.1.0\zipalign.exe > debug: zipalignapk: "c:\androidsdk\sdk\build-tools\19.1.0\zipalign.exe" -f 4 "c:\users\antony\workspace\appiumjustwink\app\justwink-usa-2.3.2.218221.69.apk" "c:\users\antony\appdata\local\temp\appium114824-5500-18wquh1.tmp" > debug: getting install status com.justwink.selendroid > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce shell "pm list packages -3 com.justwink.selendroid" > debug: app installed > debug: rebuilt selendroid installed > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce shell "getprop persist.sys.language" > debug: current device language: en > debug: java -jar "c:\program files (x86)\appium\node_modules\appium\node_modules\appium-adb\jars\strings_from_apk.jar" "c:\users\antony\workspace\appiumjustwink\app\justwink-usa-2.3.2.218221.69.apk" "c:\windows\temp\com.justwink" en > debug: no strings.xml language 'en', getting default strings.xml > debug: java -jar "c:\program files (x86)\appium\node_modules\appium\node_modules\appium-adb\jars\strings_from_apk.jar" "c:\users\antony\workspace\appiumjustwink\app\justwink-usa-2.3.2.218221.69.apk" "c:\windows\temp\com.justwink" > debug: not uninstalling app since server not started --full-reset > debug: checking app cert c:\users\antony\workspace\appiumjustwink\app\justwink-usa-2.3.2.218221.69.apk: java -jar "c:\program files (x86)\appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar" "c:\users\antony\workspace\appiumjustwink\app\justwink-usa-2.3.2.218221.69.apk" > debug: app signed. > debug: zip-aligning c:\users\antony\workspace\appiumjustwink\app\justwink-usa-2.3.2.218221.69.apk > debug: checking whether zipalign present > debug: using zipalign c:\androidsdk\sdk\build-tools\19.1.0\zipalign.exe > debug: zipalignapk: "c:\androidsdk\sdk\build-tools\19.1.0\zipalign.exe" -f 4 "c:\users\antony\workspace\appiumjustwink\app\justwink-usa-2.3.2.218221.69.apk" "c:\users\antony\appdata\local\temp\appium114824-5500-1en8ers.tmp" > debug: md5 app 3aca4df645e75a21edbbd9a27ea557db > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce shell "ls /data/local/tmp/3aca4df645e75a21edbbd9a27ea557db.apk" > debug: getting install status com.justwink > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce shell "pm list packages -3 com.justwink" > debug: app installed > info: app installed, resetting app > debug: running fast reset (stop , clear) > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce shell "am force-stop com.justwink" > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce shell "pm clear com.justwink" > debug: forwarding system:8080 device:8080 > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce forward tcp:8080 tcp:8080 > debug: pushing settings apk device... > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce install "c:\program files (x86)\appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk" > debug: pushing unlock helper app device... > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce install "c:\program files (x86)\appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk" > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce shell "dumpsys window" > debug: writing dumpsys output c:\program files (x86)\appium\node_modules\appium\.dumpsys.log > debug: screen unlocked, continuing. > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce shell "am instrument -e main_activity 'com.justwink.splashscreen.splashactivity' com.justwink.selendroid/io.selendroid.serverinstrumentation" > debug: making http request opts: {"url":"http://localhost:8080/wd/hub/status","method":"get"} > debug: making http request opts: {"url":"http://localhost:8080/wd/hub/status","method":"get"} > debug: making http request opts: {"url":"http://localhost:8080/wd/hub/status","method":"get"} > debug: making http request opts: {"url":"http://localhost:8080/wd/hub/status","method":"get"} > debug: making http request opts: {"url":"http://localhost:8080/wd/hub/status","method":"get"} > debug: making http request opts: {"url":"http://localhost:8080/wd/hub/status","method":"get"} > debug: selendroid server alive! > debug: listening selendroid logs > debug: creating selendroid session > debug: making http request opts: {"url":"http://localhost:8080/wd/hub/session","method":"post","json":{"desiredcapabilities":{"warnings":{},"desired":{"app":"c:\\users\\antony\\workspace\\appiumjustwink\\app\\justwink-usa-2.3.2.218221.69.apk","apppackage":"com.justwink","autowebviewtimeout":6000,"appwaitpackage":"com.justwink","appwaitactivity":"com.justwink.splashscreen.splashactivity","devicename":"sch-i535","autolaunch":"true","appactivity":"com.justwink.splashscreen.splashactivity","newcommandtimeout":24000,"platformversion":"4.4","automationname":"selendroid","browsername":"","autowebview":true,"platformname":"android"},"app":"c:\\users\\antony\\workspace\\appiumjustwink\\app\\justwink-usa-2.3.2.218221.69.apk","apppackage":"com.justwink","autowebviewtimeout":6000,"appwaitpackage":"com.justwink","appwaitactivity":"com.justwink.splashscreen.splashactivity","devicename":"sch-i535","autolaunch":"true","appactivity":"com.justwink.splashscreen.splashactivity","newcommandtimeout":24000,"platformversion":"4.4","automationname":"selendroid","browsername":"","autowebview":true,"platformname":"android"}}} > debug: started selendroid session > debug: waiting pkg "com.justwink" , activity "com.justwink.splashscreen.splashactivity" focused > debug: getting focused package , activity > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce shell "dumpsys window windows" > debug: [selendroid] http://localhost:8080/wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba > debug: setting auto webview > debug: getting list of available webviews > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce shell "cat /proc/net/unix" > debug: available contexts: undefined > debug: [] > debug: making http request opts: {"url":"http://localhost:8080/wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba/window_handles","method":"get"} > debug: retrying context switch timeout '6000' > debug: getting list of available webviews > debug: executing: "c:\androidsdk\sdk\platform-tools\adb.exe" -s 43013dce shell "cat /proc/net/unix" > debug: available contexts: native_app > debug: [] > debug: making http request opts: {"url":"http://localhost:8080/wd/hub/session/a7755f7f-4b4b- ceb1-758d-8e938724c2ba/window_handles","method":"get"} > debug: overriding session id "a7755f7f-4b4b-ceb1-758d-8e938724c2ba" > info: <-- post /wd/hub/session 303 37750.184 ms - 9  > debug: device launched! ready commands > debug: setting command timeout 24000 secs > debug: appium session started sessionid a7755f7f-4b4b-ceb1-758d-8e938724c2ba > info: --> /wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba {} > debug: appium request initiated @ /wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba > debug: request received params: {} > debug: proxying command localhost:8080 > debug: making http request opts: {"url":"http://localhost:8080/wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba","method":"get"} > debug: proxied response received status 200: "{\"value\":{\"automationname\":\"selendroid\",\"platform\":\"android\",\"platformversion\":\"18\",\"acceptsslcerts\":true,\"javascriptenabled\":true,\"platformname\":\"android\",\"handlesalerts\":true,\"browsername\":\"selendroid\",\"networkconnectionenabled\":true,\"rotatable\":true,\"takesscreenshot\":true,\"version\":\"0.10.0\"},\"status\":0,\"sessionid\":\"a7755f7f-4b4b-ceb1-758d-8e938724c2ba\"}" > info: <-- /wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba 200 64.131 ms - 358  > info: --> post /wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba/timeouts/implicit_wait {"ms":160000} > debug: appium request initiated @ /wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba/timeouts/implicit_wait > debug: request received params: {"ms":160000} > debug: proxying command localhost:8080 > debug: making http request opts: {"url":"http://localhost:8080/wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba/timeouts/implicit_wait","method":"post","json":{"ms":160000}} > debug: proxied response received status 200: {"value":"","status":0,"sessionid":"a7755f7f-4b4b-ceb1-758d-8e938724c2ba"} > info: <-- post /wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba/timeouts/implicit_wait 200 66.321 ms - 74  > info: --> post /wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba/element {"using":"xpath","value":"//android.widget.button[2]"} > debug: appium request initiated @ /wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba/element > debug: request received params: {"using":"xpath","value":"//android.widget.button[2]"} > debug: proxying command localhost:8080 > debug: making http request opts: {"url":"http://localhost:8080/wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba/element","method":"post","json":{"using":"xpath","value":"//android.widget.button[2]"}} > debug: responding client error: {"status":7,"value":{"message":"an element not located on page using given search parameters.","origvalue":"element not found.\nio.selendroid.exceptions.nosuchelementexception: element not found.\n\tat io.selendroid.server.handler.findelement.handle(findelement.java:57)\n\tat io.selendroid.server.androidservlet.handlerequest(androidservlet.java:290)\n\tat io.selendroid.server.baseservlet.handlehttprequest(baseservlet.java:70)\n\tat org.webbitserver.netty.nettyhttpcontrol.nexthandler(nettyhttpcontrol.java:78)\n\tat org.webbitserver.netty.nettyhttpcontrol.nexthandler(nettyhttpcontrol.java:62)\n\tat io.selendroid.server.inspector.inspectorservlet.handlehttprequest(inspectorservlet.java:78)\n\tat org.webbitserver.netty.nettyhttpcontrol.nexthandler(nettyhttpcontrol.java:78)\n\tat org.webbitserver.netty.nettyhttpcontrol.nexthandler(nettyhttpcontrol.java:62)\n\tat org.webbitserver.handler.pathmatchhandler.handlehttprequest(pathmatchhandler.java:33)\n\tat org.webbitserver.netty.nettyhttpcontrol.nexthandler(nettyhttpcontrol.java:78)\n\tat org.webbitserver.netty.nettyhttpcontrol.nexthandler(nettyhttpcontrol.java:62)\n\tat org.webbitserver.handler.dateheaderhandler.handlehttprequest(dateheaderhandler.java:21)\n\tat org.webbitserver.netty.nettyhttpcontrol.nexthandler(nettyhttpcontrol.java:78)\n\tat org.webbitserver.netty.nettyhttpcontrol.nexthandler(nettyhttpcontrol.java:62)\n\tat org.webbitserver.handler.serverheaderhandler.handlehttprequest(serverheaderhandler.java:25)\n\tat org.webbitserver.netty.nettyhttpcontrol.nexthandler(nettyhttpcontrol.java:78)\n\tat org.webbitserver.netty.nettyhttpcontrol.nexthandler(nettyhttpcontrol.java:67)\n\tat   org.webbitserver.netty.nettyhttpchannelhandler$2.run(nettyhttpchannelhandler.java:72)\n\tat java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1080)\n\tat   java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:573)\n\tat java.lang.thread.run(thread.java:841)\n"},"sessionid":"a7755f7f-4b4b-ceb1-758d-8e938724c2ba"} > info: <-- post /wd/hub/session/a7755f7f-4b4b-ceb1-758d-8e938724c2ba/element 500 160247.347 ms - 2040  

code:

desiredcapabilities capabilities = new desiredcapabilities();  capabilities.setcapability("browsername", ""); capabilities.setcapability("platformversion", "4.4"); capabilities.setcapability("platformname", "android"); capabilities.setcapability("app", app.getabsolutepath()); capabilities.setcapability("devicename", "sch-i535"); //capabilities.setcapability("devicename", "emulator-5554"); capabilities.setcapability("autolaunch", "true"); capabilities.setcapability("apppackage", "com.justwin"); capabilities.setcapability("appwaitpackage", "com.justwin"); capabilities.setcapability("automationname", "selendroid");  //capabilities.setcapability("device", "selendroid"); capabilities.setcapability("autowebview", true);  capabilities.setcapability("newcommandtimeout",24000); capabilities.setcapability("autowebviewtimeout",6000);  capabilities.setcapability("appactivity", "com.justwink.splashscreen.splashactivity"); capabilities.setcapability("appwaitactivity", "com.justwink.splashscreen.splashactivity");  try {   driver = new appiumdriver(new url("http://127.0.0.1:4723/wd/hub"),capabilities);  } catch (exception e) {  e.printstacktrace(); }  driver.manage().timeouts().implicitlywait(160, timeunit.seconds); }  @test public void testuiz() {           driver.findelement(by.xpath("//android.widget.button[2]")).click();       } 

when you're asking selenium find element, seems you're giving locator strategy "id".

"using":"id", "value":"android:id/button1" 

you should using xpath locator strategy. try like:

driver.findelement(by.xpath("//classname[1]").click() 

try this. if paste source code, it'll easier debug problem.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -