Closed BSudheerR closed 5 years ago
Unfortunately this is expected behavior. The old Android driver is not capable of supporting the requirements of the test ai classifier. You need to use the UiAutomator2 driver (set automationName
capability to "UiAutomator2").
Thanks a lot , it helps me to resolve the issue.
Full log:
[BaseDriver] Didn't know about setting 'elementResponseAttributes'. Are you sure you spelled it correctly? Proceeding anyway. Valid settings: imageMatchThreshold,fixImageFindScreenshotDims,fixImageTemplateSize,fixImageTemplateScale,defaultImageTemplateScale,checkForImageElementStaleness,autoUpdateImageElementPosition,imageElementTapStrategy,ignoreUnimportantViews [ai] Setting confidence threshold to default value of 0.2 [ai] Retrieving data for all leaf-node elements on screen [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator [debug] [BaseDriver] Waiting up to 0 ms for condition [debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//[not(child::)]","context":"","multiple":true}} [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//[not(child::)]","context":"","multiple":true}} [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//[not(child::)]' using 'XPATH' with the contextId: '' multiple: true [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.ImageButton, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.ImageButton, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.ImageView, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.ImageView, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.TextView, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.TextView, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.View, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.View, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.ImageView, INSTANCE=1] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.ImageView, INSTANCE=1] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.view.View, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.Button, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.Button, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.Button, INSTANCE=1] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.Button, INSTANCE=1] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.Button, INSTANCE=2] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.Button, INSTANCE=2] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.Button, INSTANCE=3] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.Button, INSTANCE=3] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=1] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.view.View, INSTANCE=1] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.ImageView, INSTANCE=2] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.ImageView, INSTANCE=2] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.TextView, INSTANCE=1] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.TextView, INSTANCE=1] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.TextView, INSTANCE=2] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.TextView, INSTANCE=2] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.TextView, INSTANCE=3] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.TextView, INSTANCE=3] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.FrameLayout, INSTANCE=9] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.FrameLayout, INSTANCE=9] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.ImageView, INSTANCE=3] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.ImageView, INSTANCE=3] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.TextView, INSTANCE=4] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.TextView, INSTANCE=4] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.TextView, INSTANCE=5] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.TextView, INSTANCE=5] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=2] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.view.View, INSTANCE=2] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=3] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.view.View, INSTANCE=3] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=4] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.view.View, INSTANCE=4] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=5] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.view.View, INSTANCE=5] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.ImageView, INSTANCE=4] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.ImageView, INSTANCE=4] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=6] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.view.View, INSTANCE=6] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.RelativeLayout, INSTANCE=5] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.RelativeLayout, INSTANCE=5] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.ImageView, INSTANCE=5] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.ImageView, INSTANCE=5] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.EditText, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.EditText, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.ImageView, INSTANCE=6] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.ImageView, INSTANCE=6] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=7] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.view.View, INSTANCE=7] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Selector ends with instance. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":[{"ELEMENT":"1"},{"ELEMENT":"2"},{"ELEMENT":"3"},{"ELEMENT":"4"},{"ELEMENT":"5"},{"ELEMENT":"6"},{"ELEMENT":"7"},{"ELEMENT":"8"},{"ELEMENT":"9"},{"ELEMENT":"10"},{"ELEMENT":"11"},{"ELEMENT":"12"},{"ELEMENT":"13"},{"ELEMENT":"14"},{"ELEMENT":"15"},{"ELEMENT":"16"},{"ELEMENT":"17"},{"ELEMENT":"18"},{"ELEMENT":"19"},{"ELEMENT":"20"},{"ELEMENT":"21"},{"ELEMENT":"22"},{"ELEMENT":"23"},{"ELEMENT":"24"},{"ELEMENT":"25"},{"ELEMENT":"26"}]} [debug] [AndroidBootstrap] Received command result from bootstrap [ai] Getting window size in case we need to scale screenshot [debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"getDeviceSize","params":{}} [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"getDeviceSize","params":{}} [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getDeviceSize [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":{"height":1424,"width":720}} [debug] [AndroidBootstrap] Received command result from bootstrap [ai] Getting screenshot to use for classifier [ai] Turning screenshot into HTML image for use with canvas [ai] Getting screenshot slices for each element [ai] Resetting element response attribute setting to original value: undefined [debug] [W3C (75e57f0c)] Encountered internal error running command: TypeError: Cannot destructure property)
[debug] [W3C (75e57f0c)] at asyncmap (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:74:26)
[debug] [W3C (75e57f0c)] at getElementImages (/usr/local/lib/node_modules/appium/node_modules/test-ai-classifier/lib/classifier.js:174:30)
[debug] [W3C (75e57f0c)] at Object.find (/usr/local/lib/node_modules/appium/node_modules/test-ai-classifier/lib/classifier.js:274:32)
[debug] [W3C (75e57f0c)] at condition (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:158:16)
[debug] [W3C (75e57f0c)] at wrappedCondFn (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/timeout.js:157:12)
[debug] [W3C (75e57f0c)] at spin (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:112:20)
[debug] [W3C (75e57f0c)] at waitForCondition (/usr/local/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:125:10)
[debug] [W3C (75e57f0c)] at AndroidDriver.implicitWaitForCondition (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/timeout.js:159:10)
[debug] [W3C (75e57f0c)] at AndroidDriver.findByCustom (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:172:5)
[debug] [W3C (75e57f0c)] at AndroidDriver.findElement (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:50:12)
[HTTP] <-- POST /wd/hub/session/75e57f0c-9382-41b0-bc46-6d74ddf274e0/element 500 3688 ms - 611
[HTTP]
[Logcat] Logcat terminated with code 0, signal null
[UiAutomator] UiAutomator exited unexpectedly with code 0, signal null
[debug] [UiAutomator] Moving to state 'stopped'
x
of 'undefined' or 'null'. [debug] [W3C (75e57f0c)] at getCanvasByRect (/usr/local/lib/node_modules/appium/node_modules/test-ai-classifier/lib/image.js:58:9) [debug] [W3C (75e57f0c)] at /usr/local/lib/node_modules/appium/node_modules/test-ai-classifier/lib/classifier.js:176:28 [debug] [W3C (75e57f0c)] at Array.map (