javascript - Protractor script fails to execute on the android device -
my protractor config file looks this:
var myhelper = require("./myhelper.js"); exports.config = { seleniumaddress: 'http://localhost:4723/wd/hub', of appium url chromedriver: 'c:/appium/chromedriver', specs: ['tests/file1.js'], jasminenodeopts: { defaulttimeoutinterval: 180000, }, prefs: { 'profile.managed_default_content_settings.geolocation': 1, 'profile.default_content_settings.popups':0 }, multicapabilities: [ { browsername: 'chrome', platformname: 'android', platformversion: '7.0', devicename: 'ce10160a3538442705', 'newcommandtimeout' : 120, 'chromeoptions': { 'args': ["--use-fake-ui-for-media-stream", '--use-fake-device-for-media-stream', '--disable-web-security','--start-maximized','--full-reset'] }, } ], onprepare: function() { global.browsers = { a: (()=>{ browser.ignoresynchronization = true; return browser; })(), b: ()=> { var br = browser.forknewdriverinstance(false, false); br.ignoresynchronization = true; return br; }, myhelper: myhelper }; }, };
& running appium using following command:
appium -p 4723 -bp 4728 -u "ce10160a3538442705" --chromedriver-port 9516
when run protractor conf.js, android device gets unlocked chrome browser not launched , again goes unlock itself.
logs:
[androiddriver] using app unlock, going deprecated! [androiddriver] unlocking screen [debug] [adb] getting connected devices... [debug] [adb] 1 device(s) connected [debug] [adb] running 'c:\android\sdk\platform-tools\adb.exe' args: ["-p",5037,"-s","ce10160a3538442705","shell","am","force-stop","io.appium.unlock"] [debug] [adb] device api level: 24 [debug] [adb] getting connected devices... [debug] [adb] 1 device(s) connected [debug] [adb] running 'c:\android\sdk\platform-tools\adb.exe' args: ["-p",5037,"-s","ce10160a3538442705","shell","am","start","-w","-n","io.appium.unlock/.unlock","-a","android.intent.action.main","-c","android.intent.category.launcher","-f","0x10200000"] [debug] [adb] device api level: 24 [debug] [adb] getting connected devices... [debug] [adb] 1 device(s) connected [debug] [adb] running 'c:\android\sdk\platform-tools\adb.exe' args: ["-p",5037,"-s","ce10160a3538442705","shell","am","start","-w","-n","io.appium.unlock/.unlock","-a","android.intent.action.main","-c","android.intent.category.launcher","-f","0x10200000"] [debug] [adb] getting connected devices... [debug] [adb] 1 device(s) connected [debug] [adb] running 'c:\android\sdk\platform-tools\adb.exe' args: ["-p",5037,"-s","ce10160a3538442705","shell","dumpsys","window"] [debug] [adb] getting connected devices... [debug] [adb] 1 device(s) connected [debug] [adb] running 'c:\android\sdk\platform-tools\adb.exe' args: ["-p",5037,"-s","ce10160a3538442705","shell","dumpsys","window"] [debug] [androiddriver] shutting down android driver [debug] [adb] pressing home button [debug] [adb] getting connected devices... [debug] [adb] 1 device(s) connected [debug] [adb] running 'c:\android\sdk\platform-tools\adb.exe' args: ["-p",5037,"-s","ce10160a3538442705","shell","input","keyevent",3] [debug] [androidbootstrap] sending command android: {"cmd":"shutdown"} [androidbootstrap] [bootstrap log] [debug] got data client: {"cmd":"shutdown"} [androidbootstrap] [bootstrap log] [debug] got command of type shutdown [debug] [androidbootstrap] received command result bootstrap [debug] [uiautomator] shutting down uiautomator [debug] [uiautomator] moving state 'stopping' [androidbootstrap] [bootstrap log] [debug] returning result: {"status":0,"value":"ok, shutting down"} [androidbootstrap] [bootstrap log] [debug] closed client connection [debug] [androidbootstrap] [uiauto stdout] instrumentation_status: numtests=1 [debug] [androidbootstrap] [uiauto stdout] instrumentation_status: stream=. [debug] [androidbootstrap] [uiauto stdout] instrumentation_status: id=uiautomatortestrunner [debug] [androidbootstrap] [uiauto stdout] instrumentation_status: test=testrunserver [debug] [androidbootstrap] [uiauto stdout] instrumentation_status: class=io.appium.android.bootstrap.bootstrap [debug] [androidbootstrap] [uiauto stdout] instrumentation_status: current=1 [debug] [androidbootstrap] [uiauto stdout] instrumentation_status_code: 0 [debug] [androidbootstrap] [uiauto stdout] instrumentation_status: stream= [debug] [androidbootstrap] [uiauto stdout] test results watcherresultprinter=. [debug] [androidbootstrap] [uiauto stdout] time: 449.159 [debug] [androidbootstrap] [uiauto stdout] ok (1 test) [debug] [androidbootstrap] [uiauto stdout] instrumentation_status_code: -1 [debug] [uiautomator] uiautomator shut down [debug] [uiautomator] moving state 'stopped' [debug] [adb] attempting kill uiautomator processes [debug] [adb] getting processes uiautomator [debug] [adb] getting connected devices... [debug] [adb] 1 device(s) connected [debug] [adb] running 'c:\android\sdk\platform-tools\adb.exe' args: ["-p",5037,"-s","ce10160a3538442705","shell","ps"] [adb] no uiautomator process found kill, continuing... [debug] [uiautomator] moving state 'stopped' [debug] [logcat] stopping logcat capture [debug] [adb] getting connected devices... [debug] [adb] 1 device(s) connected [debug] [adb] running 'c:\android\sdk\platform-tools\adb.exe' args: ["-p",5037,"-s","ce10160a3538442705","shell","am","force-stop","io.appium.unlock"] [debug] [androiddriver] not cleaning generated files. add `clearsystemfiles` capability if wanted. [mjsonwp] encountered internal error running command: error: screen did not unlock successfully, retrying @ object.callee$1$0$ (../../lib/android-helpers.js:453:13) @ trycatch (c:\users\xxxx\appdata\roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40) @ generatorfunctionprototype.invoke [as _invoke] (c:\users\xxxx\appdata\roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22) @ generatorfunctionprototype.prototype.(anonymous function) [as next] (c:\users\xxxx\appdata\roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21) @ generatorfunctionprototype.invoke (c:\users\xxxx\appdata\roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37) @ process._tickcallback (internal/process/next_tick.js:109:7) [http] <-- post /wd/hub/session 500 463534 ms - 181
i figured issue here. device set on auto lock after 30 secs because of whenever took appium around 30 secs start, trying unlock device again. wonder if disabling auto lock option.
Comments
Post a Comment