Git Product home page Git Product logo

appium-uiautomator2-server's Introduction

appium-uiautomator2-server

NPM version Downloads

A netty server that runs on the device listening for commands and executes using UiAutomator V2.

building project

build the android project using below commands

gradle clean assembleServerDebug assembleServerDebugAndroidTest

Starting server

push both src and test apks to the device and execute the instrumentation tests.

adb shell am instrument -w io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner

run unitTest

build the unitTest flavor using the below commands

gradle clean assembleE2ETestDebug assembleE2ETestDebugAndroidTest

unitTest flavor contains tests for handlers and can be invoked by using following command

gradle clean connectedE2ETestDebugAndroidTest

the above command takes care about installing the AUT apk in to the testing device/emulator before running the tests.

you can also invoke the test using below command

adb shell am instrument -w io.appium.uiautomator2.e2etest.test/androidx.test.runner.AndroidJUnitRunner

Note: AUT apk should be installed before executing above command.

Other Sections:

appium-uiautomator2-server's People

Contributors

ajeeshvl avatar alexander-kachechka avatar anandsadu avatar carlgege avatar danielputerman avatar dependabot-preview[bot] avatar dependabot[bot] avatar dpgraham avatar greenkeeper[bot] avatar imurchie avatar jatalahd avatar jjangah avatar jlipps avatar jzaleski avatar kazucocoa avatar meprabhatr avatar mgkeeley avatar mykola-mokhnach avatar prakashgoulla avatar rerorero avatar rjaros87 avatar sanebow avatar semantic-release-bot avatar shashank2086 avatar sravanmedarapu avatar tri-fraga avatar vijay-chavakula avatar vmaxim avatar yaumu3 avatar yoshitaka-ogata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appium-uiautomator2-server's Issues

UiAutomator2 fails to scroll down the list to the end and throws NoSuchElement exception

Appium server: 1.7.1
Appium client: wd.js 1.4.1
Env: MacOS Sierra, Android 5.0 emulator, automationName = UiAutomator2

UiAutomator2 fails to scroll down list to the end, throws exception:
elementByAndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textStartsWith(\"2016\").instance(0))")] Error response status: 7, , NoSuchElement - An element could not be located on the page using the given search parameters. Selenium error: An element could not be located on the page using the given search parameters

Screenshot shows were it stuck: http://prntscr.com/hjt3y8

Works perfectly with original UiAutomator (automationName=Appium)

how to get an webview element?

hi, i can't get any webview elements when set 'automationName' as "uiautomator2". but it works when using default 'automationName'.

key code: el_rate_view_parent = self.findElement(By.ID, "rateIconWrap")
image

appium version : 1.6.3
platform : Android
platform version: 7.1.1

have i made any obvious mistakes?
sorry for my poor english... ^.^

Issue in finding element using findElementByAndroidUIAutomator with uiautomator2

Hi there,
I am finding issue in finding elements using uiautomator after upgrading to appium 1.6+ version with uiautomator2 capabilities.

Please find the details below:
Appium Version: 1.6.5 (installed via npm)
Applium java client - 5.0.0-BETA8
capabilities.setCapability("automationName", "uiautomator2"); - set the capability in the code

Android Physical Device S6, Version - 7.0

Find Element code:
String args = "new UiScrollable(new UiSelector().scrollable(true).instance(0)).getChildByText(new UiSelector().className("android.widget.TextView"),"Log off")";
try {
WebDriverWait wait = new WebDriverWait(driver, 5, 100);
wait.ignoring(org.openqa.selenium.NoSuchElementException.class);
wait.until(ExpectedConditions.presenceOfElementLocated(MobileBy.AndroidUIAutomator(args)));
AndroidElement element = (AndroidElement) driver.findElementByAndroidUIAutomator(args);
Main.logMessage("AndroidElement for " + locator + " found");
return element;
} catch (Exception e) {
Main.logMessage("AndroidElement " + locator + " not found");
throw new Exception("Unable to locate element: " + e);
}

Note: Log off button is in the end of the screen and it does scrolls down and log off button is visible in the UI (after it scrolls) but it just waits and then throws ESSocket Time out error.
Also though I pass in 5 seconds wait time webdriver wait it actually wait for longer time around 4 to 5 minutes and then throws socket time out error. I am not sure whether the issue is with the uiautomator2 or issue with wait time?

Appium logs:
[HTTP] <-- POST /wd/hub/session/28549bb9-8a4b-46c4-8a52-dfbb493f9501/elements 200 83 ms - 74
[HTTP] --> POST /wd/hub/session/28549bb9-8a4b-46c4-8a52-dfbb493f9501/elements {"using":"-android uiautomator","value":"new UiScrollable(new UiSelector().scrollable(true).instance(0)).getChildByText(new UiSelector().className("android.widget.TextView"),"Log off")"}
[debug] [MJSONWP] Calling AppiumDriver.findElements() with args: ["-android uiautomator","new UiScrollable(new UiSelector().scrollable(true).instance(0)).getChildByText(new UiSelector().className("android.widget.TextView"),"Log off")","28549bb9-8a4b-46c4-8a52-dfbb493f9501"]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[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] [JSONWP Proxy] Proxying [POST /elements] to [POST http://localhost:8217/wd/hub/session/f0124e6d-2b0b-4533-8c37-8d4c292baba7/elements] with body: {"strategy":"-android uiautomator","selector":"new UiScrollable(new UiSelector().scrollable(true).instance(0)).getChildByText(new UiSelector().className("android.widget.TextView"),"Log off")","context":"","multiple":true}
[MJSONWP] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: Error: ESOCKETTIMEDOUT
at JWProxy.proxy$ (../../../lib/jsonwp-proxy/proxy.js:153:13)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[HTTP] <-- POST /wd/hub/session/28549bb9-8a4b-46c4-8a52-dfbb493f9501/elements 500 240019 ms - 251

Please note, same code is working fine on older android versions (< 7.0) with uiautomator1. Also the wait condition works as expected in the lower versions.

I am blocked with executing tests on higher android versions due to the above issue.

Unable to get location_in_view on an element

Settings:

  1. Client: Python
  2. DesiredCapabilities are as below:
    PIXEL_OREO = {
    'platformName': 'Android',
    'platformVersion': '8.1.0',
    'deviceName': 'Pixel',
    'newCommandTimeout': 240,
    'noSign': 'true',
    'fullReset': 'true',
    'automationName': 'uiautomator2',
    'appActivity': 'com.me.android.app.controller.SplashActivity',
    'appWaitActivity': 'com.me.android.app.controller.SplashActivity, com.me.android.app.controller.ftue.NewFtueActivity'
    },
  3. Action on an element: element.location_in_view
  4. Appium Desktop 1.2.7 (which has Appium 1.7.1 and uiautomator2 server 0.1.8)

Issue:
Whenever I use "uiautomator2" as automationName for desired capabilities the following error will occur. HOWEVER if "appium" is set as the value for "automationName" that method location_in_view is executed fine.

From the error info it seems like location_in_view is not supported via uiautomator2? Is that true or do I need to change anything? Thanks.

[HTTP] <-- GET /wd/hub/session/3d2b3212-97c1-4473-b560-05f57b1b732e/element/52d2efbd-0b46-4710-901c-792b13d6cc12/size 200 34 ms - 97
[HTTP] --> GET /wd/hub/session/3d2b3212-97c1-4473-b560-05f57b1b732e/element/52d2efbd-0b46-4710-901c-792b13d6cc12/location_in_view {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[JSONWP Proxy] Proxying [GET /wd/hub/session/3d2b3212-97c1-4473-b560-05f57b1b732e/element/52d2efbd-0b46-4710-901c-792b13d6cc12/location_in_view] to [GET http://localhost:8200/wd/hub/session/f8fb7b76-b4a9-41f7-a4ee-c3b10b1babec/element/52d2efbd-0b46-4710-901c-792b13d6cc12/location_in_view] with body: {}
[MJSONWP] Encountered internal error running command: Error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: 404 - ""
at doJwpProxy$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/mjsonwp/mjsonwp.js:384:13)
at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[HTTP] <-- GET /wd/hub/session/3d2b3212-97c1-4473-b560-05f57b1b732e/element/52d2efbd-0b46-4710-901c-792b13d6cc12/location_in_view 500 45 ms - 269
[HTTP] --> DELETE /wd/hub/session/3d2b3212-97c1-4473-b560-05f57b1b732e {}
[MJSONWP] Calling AppiumDriver.deleteSession() with args: ["3d2b3212-97c1-4473-b560-05f57b1b732e"]

UiObject2 referring to wrong element

The Problem:
Referring to previously created element which is not exist in the screen (in the same activity/view) pointing to a random element instead of throwing StaleObjectException in Scrollable view.

Happens only with UiObject2 elements.

Reported in google UIAutomator2

How to configure appium 1.6.4 switch to UIAutomator2 ?

i need to use new UIAutomator2 on my appium project.

C:\Users\shuiboluo>appium-doctor
info AppiumDoctor Appium Doctor v.1.2.5
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor ✔ ANDROID_HOME is set to: D:\automatic-soft\Android\sdk
info AppiumDoctor ✔ JAVA_HOME is set to: C:\ORACLE\jdk1.8.131
info AppiumDoctor ✔ adb exists at: D:\automatic-soft\Android\sdk\platform-tools\adb.exe
info AppiumDoctor ✔ android exists at: D:\automatic-soft\Android\sdk\tools\android.bat
info AppiumDoctor ✔ emulator exists at: D:\automatic-soft\Android\sdk\tools\emulator.exe
info AppiumDoctor ✔ Bin directory of $JAVA_HOME is set
info AppiumDoctor ### Diagnostic completed, no fix needed. ###
info AppiumDoctor
info AppiumDoctor Everything looks good, bye!
info AppiumDoctor

Execute UiAutomator commands within appium script

I was wonder if there a way to execute UiAutomator commands straight from appium test ?

The only API I do see is "findElementByAndroidUIAutomator" which expect to get a return value from uiutomator (UiScrollable / UiObject) in order to look after it.

In my flow I trying to execute a UiScrollable().flingBackward() command which returns boolean value ...

Is there a way to achieve it ?

Having parentheses in argument for UiSelector breaks with 'unclosed paren in expression'

Method consumeFunctionCall() in uiautomator2/utils/UiSelectorParser.java makes sure that there are same number of ( and ) and extracts the arguments between them.

But if I want to send a query that contains a parentheses that is not closed, like:

new UiSelector().text("A(B")

This should be allowed. Or at least function should verify if parentheses are escaped and let those pass.

Any suggestion for me to search text on Android other than xpath?

@imurchie

Thanks

ImplicitlyWait don't work on appium 1.8 with UIautomator2

When my test can't find element immediately and appium trying to waiting up for it then server rise exception.
With previous versions of appium server or without uiautoamtor2 all works pretty good.

Environment

Appium 1.8.9
Appium-java-client 6.0.0
UIAutomator2 (1.12.0)
MacOS High Sierra 10.13.4 (17E199)
AVD

Appium logs

[debug] [W3C] Calling AppiumDriver.findElement() with args: ["xpath","//*[@text='Показывать Intro при каждом логине']","474b155f-9244-43f8-a32f-d18339dba82b"]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 50000 ms for condition
[debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8297/wd/hub/session/2fee2063-ea91-4a59-a64a-c4a4776b7047/element] with body: {"strategy":"xpath","selector":"//*[@text='Показывать Intro при каждом логине']","context":"","multiple":false}
[W3C] Encountered internal error running command:  {"w3cStatus":400,"jsonwp":{"sessionId":"2fee2063-ea91-4a59-a64a-c4a4776b7047","status":7,"value":"An element could not be located on the page using the given search parameters."}} ProxyRequestError: Could not proxy command to remote server. Original error: 500 - {"sessionId":"2fee2063-ea91-4a59-a64a-c4a4776b7047","status":7,"value":"An element could not be located on the page using the given search parameters."}
[W3C]     at JWProxy.proxy$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:152:13)
[W3C]     at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[W3C]     at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[W3C]     at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[W3C]     at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[W3C]     at <anonymous>
[debug] [MJSONWP] Matched JSONWP error code 7 to NoSuchElementError

Driver caps

capabilities.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, true);
        capabilities.setCapability(AndroidMobileCapabilityType.UNICODE_KEYBOARD, true);
        capabilities.setCapability(AndroidMobileCapabilityType.RESET_KEYBOARD, true);
        capabilities.setCapability(AndroidMobileCapabilityType.APP_WAIT_ACTIVITY, appSettings.getPackageName() + appSettings.getStartPageId());
        capabilities.setCapability(MobileCapabilityType.CLEAR_SYSTEM_FILES, true);
        capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "UiAutomator2");
        capabilities.setCapability(AndroidMobileCapabilityType.SYSTEM_PORT, driversSettings.getSystemPort());

DriversSettings.builder()
                .appiumRemoteUrl(appiumURL)
                .deviceName(props.getProperty(DEVICE_NAME))
                .UDID(props.getProperty(UDID))
                .filePath(props.getProperty(FILE_PATH))
                .implicitlyWaitInSeconds(50)
                .findingTimeOutInSeconds(50)
                .newCommandTimeoutInSeconds(50)

It doesn't work

Find element by xpath with attribute selector doesn't work.

scrollable, checkable, clickable, longClickable always return false.

Waiting up to 20000ms for UiAutomator2 to be online... server fails to start test for more than 100+ test cases

##Waiting up to 20000ms for UiAutomator2 to be online...
And UIAutomator2 server never goes up after some retries.

For 100+ test cases executing in parallel , sometimes UIAutomator2 server goes down and the execution halts.

Solution:
Requires uninstallation of UIAutomator server and test apk from the device.

This issues happens once in 10 times for parallel execution

Environment
UIAutomator2 apk version : 1.8
Appium desktop 1.7
ANdroid device : 6.0.1
java client :5
OS : Windows

Code To Reproduce Issue [ Good To Have ]

Try closing you old appium session forcefully , for the next session UIAutomator2 fails to go online.

Logs

[DEBUG] 2017-12-13 13:16:39,910 com.qklab.appium.Initiator$1 run - APPIUM: [HTTP] --> GET /wd/hub/status {} [DEBUG] 2017-12-13 13:16:39,910 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: [] [DEBUG] 2017-12-13 13:16:39,913 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.7.1","revision":null}} [DEBUG] 2017-12-13 13:16:39,914 com.qklab.appium.Initiator$1 run - APPIUM: [HTTP] <-- GET /wd/hub/status 200 3 ms - 83 [DEBUG] 2017-12-13 13:16:40,433 com.qklab.appium.Initiator$1 run - APPIUM: [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"appPackage":"com.phonepe.app","appActivity":"com.phonepe.app.ui.activity.Navigator_MainActivity","acceptSslCerts":true,"noReset":"true","newCommandTimeout":"1800","platformVersion":"6.0.1","loggingPrefs":{"driver":"SEVERE"},"automationName":"uiautomator2","udid":"df7cc4df","platformName":"Android","deviceName":"Samsung","systemPort":"41274"},"requiredCapabilities":{},"capabilities":{"desiredCapabilities":{"appPackage":"com.phonepe.app","appActivity":"com.phonepe.app.ui.activity.Navigator_MainActivity","acceptSslCerts":true,"noReset":"true","newCommandTimeout":"1800","platformVersion":"6.0.1","loggingPrefs":{"driver":"SEVERE"},"automationName":"uiautomator2","udid":"df7cc4df","platformName":"Android","deviceName":"Samsung","systemPort":"41274"},"requiredCapabilities":{},"alwaysMatch":{"platformName":"Android"},"firstMatch":[]}} [DEBUG] 2017-12-13 13:16:40,433 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"appPackage":"com.phonepe.app","appActivity":"com.phonepe.app.ui.activity.Navigator_MainActivity","acceptSslCerts":true,"noReset":"true","newCommandTimeout":"1800","platformVersion":"6.0.1","loggingPrefs":{"driver":"SEVERE"},"automationName":"uiautomator2","udid":"df7cc4df","platformName":"Android","deviceName":"Samsung","systemPort":"41274"},{},{"desiredCapabilities":{"appPackage":"com.phonepe.app","appActivity":"com.phonepe.app.ui.activity.Navigator_MainActivity","acceptSslCerts":true,"noReset":"true","newCommandTimeout":"1800","platformVersion":"6.0.1","loggingPrefs":{"driver":"SEVERE"},"automationName":"uiautomator2","udid":"df7cc4df","platformName":"Android","deviceName":"Samsung","systemPort":"41274"},"requiredCapabilities":{},"alwaysMatch":{"platformName":"Android"},"firstMatch":[]}] [DEBUG] 2017-12-13 13:16:40,434 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [BaseDriver] Event 'newSessionRequested' logged at 1513151200434 (13:16:40 GMT+0530 (India Standard Time)) [DEBUG] 2017-12-13 13:16:40,437 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] Creating new AndroidUiautomator2Driver (v0.6.5) session [DEBUG] 2017-12-13 13:16:40,437 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] Capabilities: [DEBUG] 2017-12-13 13:16:40,438 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] appPackage: 'com.phonepe.app' [DEBUG] 2017-12-13 13:16:40,439 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] appActivity: 'com.phonepe.app.ui.activity.Navigator_MainActivity' [DEBUG] 2017-12-13 13:16:40,439 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] acceptSslCerts: true [DEBUG] 2017-12-13 13:16:40,439 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] noReset: 'true' [DEBUG] 2017-12-13 13:16:40,439 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] newCommandTimeout: '1800' [DEBUG] 2017-12-13 13:16:40,439 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] platformVersion: '6.0.1' [DEBUG] 2017-12-13 13:16:40,439 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] loggingPrefs: { driver: 'SEVERE' } [DEBUG] 2017-12-13 13:16:40,439 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] automationName: 'uiautomator2' [DEBUG] 2017-12-13 13:16:40,439 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] udid: 'df7cc4df' [DEBUG] 2017-12-13 13:16:40,439 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] platformName: 'Android' [DEBUG] 2017-12-13 13:16:40,439 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] deviceName: 'Samsung' [DEBUG] 2017-12-13 13:16:40,439 com.qklab.appium.Initiator$1 run - APPIUM: [Appium] systemPort: '41274' [DEBUG] 2017-12-13 13:16:40,443 com.qklab.appium.Initiator$1 run - APPIUM: [BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior [DEBUG] 2017-12-13 13:16:40,444 com.qklab.appium.Initiator$1 run - APPIUM: [BaseDriver] Capability 'newCommandTimeout' changed from string ('1800') to integer (1800). This may cause unexpected behavior [DEBUG] 2017-12-13 13:16:40,447 com.qklab.appium.Initiator$1 run - APPIUM: [BaseDriver] The following capabilities were provided, but are not recognized by appium: acceptSslCerts, loggingPrefs, systemPort. [DEBUG] 2017-12-13 13:16:40,448 com.qklab.appium.Initiator$1 run - APPIUM: [BaseDriver] Session created with session id: 5fcca401-3d26-4120-b84f-003aa15951b3 [DEBUG] 2017-12-13 13:16:40,450 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [AndroidDriver] Getting Java version [DEBUG] 2017-12-13 13:16:40,524 com.qklab.appium.Initiator$1 run - APPIUM: [AndroidDriver] Java version is: 1.8.0_51 [DEBUG] 2017-12-13 13:16:40,524 com.qklab.appium.Initiator$1 run - APPIUM: [DEBUG] 2017-12-13 13:16:40,527 com.qklab.appium.Initiator$1 run - APPIUM: [ADB] Checking whether adb is present [DEBUG] 2017-12-13 13:16:40,529 com.qklab.appium.Initiator$1 run - APPIUM: [ADB] Using adb.exe from D:\android-sdk\platform-tools\adb.exe [DEBUG] 2017-12-13 13:16:40,529 com.qklab.appium.Initiator$1 run - APPIUM: [AndroidDriver] Retrieving device list [DEBUG] 2017-12-13 13:16:40,529 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Trying to find a connected android device [DEBUG] 2017-12-13 13:16:40,530 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:40,549 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:40,550 com.qklab.appium.Initiator$1 run - APPIUM: [AndroidDriver] Using device: df7cc4df [DEBUG] 2017-12-13 13:16:40,551 com.qklab.appium.Initiator$1 run - APPIUM: [ADB] Checking whether adb is present [DEBUG] 2017-12-13 13:16:40,552 com.qklab.appium.Initiator$1 run - APPIUM: [ADB] Using adb.exe from D:\android-sdk\platform-tools\adb.exe [DEBUG] 2017-12-13 13:16:40,552 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Setting device id to df7cc4df [DEBUG] 2017-12-13 13:16:40,552 com.qklab.appium.Initiator$1 run - APPIUM: [AndroidDriver] No app sent in, not parsing package/activity [DEBUG] 2017-12-13 13:16:40,553 com.qklab.appium.Initiator$1 run - APPIUM: [ADB] Getting device platform version [DEBUG] 2017-12-13 13:16:40,553 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:40,571 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:40,574 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","getprop","ro.build.version.release"] [DEBUG] 2017-12-13 13:16:40,646 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Current device property 'ro.build.version.release': 6.0.1 [DEBUG] 2017-12-13 13:16:40,646 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:40,664 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:40,664 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","wm","size"] [DEBUG] 2017-12-13 13:16:42,170 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:42,188 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:42,189 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","getprop","ro.product.model"] [DEBUG] 2017-12-13 13:16:42,241 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Current device property 'ro.product.model': SM-J510FN [DEBUG] 2017-12-13 13:16:42,242 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:42,259 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:42,259 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","getprop","ro.product.manufacturer"] [DEBUG] 2017-12-13 13:16:42,312 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Current device property 'ro.product.manufacturer': samsung [DEBUG] 2017-12-13 13:16:42,313 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:42,331 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:42,331 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","am","force-stop","io.appium.uiautomator2.server"] [DEBUG] 2017-12-13 13:16:43,841 com.qklab.appium.Initiator$1 run - APPIUM: [ADB] Checking whether aapt is present [DEBUG] 2017-12-13 13:16:43,842 com.qklab.appium.Initiator$1 run - APPIUM: [ADB] Using aapt.exe from D:\android-sdk\build-tools\26.0.2\aapt.exe [DEBUG] 2017-12-13 13:16:43,859 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting install status for io.appium.uiautomator2.server [DEBUG] 2017-12-13 13:16:43,859 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:43,877 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:43,878 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","pm","list","packages","io.appium.uiautomator2.server"] [DEBUG] 2017-12-13 13:16:45,228 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] App is installed [DEBUG] 2017-12-13 13:16:45,228 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting install status for io.appium.uiautomator2.server.test [DEBUG] 2017-12-13 13:16:45,228 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:45,247 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:45,247 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","pm","list","packages","io.appium.uiautomator2.server.test"] [DEBUG] 2017-12-13 13:16:46,611 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] App is installed [DEBUG] 2017-12-13 13:16:46,612 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting package info for io.appium.uiautomator2.server [DEBUG] 2017-12-13 13:16:46,612 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:46,630 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:46,630 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","dumpsys","package","io.appium.uiautomator2.server"] [DEBUG] 2017-12-13 13:16:46,711 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [UiAutomator2] Waiting up to 20000ms for instrumentation 'io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner' to be available [DEBUG] 2017-12-13 13:16:46,712 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:46,730 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:46,730 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","pm","list","instrumentation"] [DEBUG] 2017-12-13 13:16:47,992 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [UiAutomator2] Instrumentation 'io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner' available [DEBUG] 2017-12-13 13:16:47,993 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","wait-for-device"] [DEBUG] 2017-12-13 13:16:48,012 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:48,030 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:48,030 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","echo","ping"] [DEBUG] 2017-12-13 13:16:48,086 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [Logcat] Starting logcat capture [DEBUG] 2017-12-13 13:16:48,137 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [AndroidDriver] Pushing settings apk to device... [DEBUG] 2017-12-13 13:16:48,137 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Uninstalling and re-installing 'io.appium.settings' [DEBUG] 2017-12-13 13:16:48,138 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Uninstalling io.appium.settings [DEBUG] 2017-12-13 13:16:48,138 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting install status for io.appium.settings [DEBUG] 2017-12-13 13:16:48,138 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:48,156 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:48,156 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","pm","list","packages","io.appium.settings"] [DEBUG] 2017-12-13 13:16:49,858 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] App is installed [DEBUG] 2017-12-13 13:16:49,858 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:49,876 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:49,877 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","am","force-stop","io.appium.settings"] [DEBUG] 2017-12-13 13:16:51,384 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","uninstall","io.appium.settings"] [DEBUG] 2017-12-13 13:16:53,345 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] ADB command output: Success [DEBUG] 2017-12-13 13:16:53,345 com.qklab.appium.Initiator$1 run - APPIUM: [ADB] io.appium.settings was successfully uninstalled [DEBUG] 2017-12-13 13:16:53,346 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting install status for io.appium.settings [DEBUG] 2017-12-13 13:16:53,346 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:53,364 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:53,364 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","pm","list","packages","io.appium.settings"] [DEBUG] 2017-12-13 13:16:54,960 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] App is not installed [DEBUG] 2017-12-13 13:16:54,960 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] App 'D:\appium-desktop\resources\app\node_modules\appium\node_modules\io.appium.settings\app\build\outputs\apk\settings_apk-debug.apk' not installed. Installing [DEBUG] 2017-12-13 13:16:54,961 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","install","D:\appium-desktop\resources\app\node_modules\appium\node_modules\io.appium.settings\app\build\outputs\apk\settings_apk-debug.apk"] [DEBUG] 2017-12-13 13:16:57,640 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:57,659 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:57,659 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","getprop","ro.build.version.sdk"] [DEBUG] 2017-12-13 13:16:57,726 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Current device property 'ro.build.version.sdk': 23 [DEBUG] 2017-12-13 13:16:57,726 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Device API level: 23 [DEBUG] 2017-12-13 13:16:57,727 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:57,744 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:57,744 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","dumpsys","package","io.appium.settings"] [DEBUG] 2017-12-13 13:16:57,847 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:16:57,864 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:16:57,865 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","pm","dump","io.appium.settings"] [DEBUG] 2017-12-13 13:17:00,511 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Got the following command chunks to execute: pm,grant,io.appium.settings,android.permission.INTERNET,;,pm,grant,io.appium.settings,android.permission.CHANGE_NETWORK_STATE,;,pm,grant,io.appium.settings,android.permission.ACCESS_NETWORK_STATE,;,pm,grant,io.appium.settings,android.permission.READ_PHONE_STATE,;,pm,grant,io.appium.settings,android.permission.WRITE_SETTINGS,;,pm,grant,io.appium.settings,android.permission.CHANGE_WIFI_STATE,;,pm,grant,io.appium.settings,android.permission.ACCESS_WIFI_STATE,;,pm,grant,io.appium.settings,android.permission.ACCESS_FINE_LOCATION,;,pm,grant,io.appium.settings,android.permission.ACCESS_COARSE_LOCATION,;,pm,grant,io.appium.settings,android.permission.ACCESS_MOCK_LOCATION,;,pm,grant,io.appium.settings,android.permission.SET_ANIMATION_SCALE,; [DEBUG] 2017-12-13 13:17:00,511 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:17:00,583 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:17:00,584 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","pm","grant","io.appium.settings","android.permission.INTERNET",";","pm","grant","io.appium.settings","android.permission.CHANGE_NETWORK_STATE",";","pm","grant","io.appium.settings","android.permission.ACCESS_NETWORK_STATE",";","pm","grant","io.appium.settings","android.permission.READ_PHONE_STATE",";","pm","grant","io.appium.settings","android.permission.WRITE_SETTINGS",";","pm","grant","io.appium.settings","android.permission.CHANGE_WIFI_STATE",";","pm","grant","io.appium.settings","android.permission.ACCESS_WIFI_STATE",";","pm","grant","io.appium.settings","android.permission.ACCESS_FINE_LOCATION",";","pm","grant","io.appium.settings","android.permission.ACCESS_COARSE_LOCATION",";","pm","grant","io.appium.settings","android.permission.ACCESS_MOCK_LOCATION",";","pm","grant","io.appium.settings","android.permission.SET_ANIMATION_SCALE",";"] [DEBUG] 2017-12-13 13:17:15,008 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:17:15,027 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:17:15,027 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","ps"] [DEBUG] 2017-12-13 13:17:15,283 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Device API level: 23 [DEBUG] 2017-12-13 13:17:15,284 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:17:15,302 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:17:15,302 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","am","start","-W","-n","io.appium.settings/.Settings","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"] [DEBUG] 2017-12-13 13:17:17,594 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Device API level: 23 [DEBUG] 2017-12-13 13:17:17,594 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:17:17,612 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:17:17,613 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","appops","set","io.appium.settings","android:mock_location","allow"] [DEBUG] 2017-12-13 13:17:19,392 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [AndroidDriver] Pushing unlock helper app to device... [DEBUG] 2017-12-13 13:17:19,392 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","install","D:\appium-desktop\resources\app\node_modules\appium\node_modules\appium-unlock\bin\unlock_apk-debug.apk"] [DEBUG] 2017-12-13 13:17:21,287 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 41274 [DEBUG] 2017-12-13 13:17:21,287 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Forwarding system: 41274 to device: 6790 [DEBUG] 2017-12-13 13:17:21,287 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","forward","tcp:41274","tcp:6790"] [DEBUG] 2017-12-13 13:17:21,305 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:17:21,323 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:17:21,324 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","dumpsys","window"] [DEBUG] 2017-12-13 13:17:21,436 com.qklab.appium.Initiator$1 run - APPIUM: [AndroidDriver] Screen already unlocked, doing nothing [DEBUG] 2017-12-13 13:17:21,437 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [AndroidDriver] Extracting strings from apk null null C:\Users\TS90US~1\AppData\Local\Temp\4\com.phonepe.app [DEBUG] 2017-12-13 13:17:21,438 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Extracting strings for language: default [DEBUG] 2017-12-13 13:17:21,438 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Device API level: 23 [DEBUG] 2017-12-13 13:17:21,438 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:17:21,456 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:17:21,456 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","getprop","persist.sys.locale"] [DEBUG] 2017-12-13 13:17:21,544 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Current device property 'persist.sys.locale': en-GB [DEBUG] 2017-12-13 13:17:21,667 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] No strings.xml for language 'en', getting default strings.xml [DEBUG] 2017-12-13 13:17:21,809 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:17:21,827 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:17:21,828 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","rm","-rf","/data/local/tmp/strings.json"] [DEBUG] 2017-12-13 13:17:21,899 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [UiAutomator2] No app capability. Assuming it is already on the device [DEBUG] 2017-12-13 13:17:21,903 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] APK doesn't exist. null [DEBUG] 2017-12-13 13:17:21,904 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Getting connected devices... [DEBUG] 2017-12-13 13:17:21,921 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] 2 device(s) connected [DEBUG] 2017-12-13 13:17:21,921 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [ADB] Running 'D:\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","df7cc4df","shell","am","force-stop","io.appium.uiautomator2.server"] [DEBUG] 2017-12-13 13:17:23,374 com.qklab.appium.Initiator$1 run - APPIUM: [UiAutomator2] Starting uiautomator2 server v0.1.8 [DEBUG] 2017-12-13 13:17:23,375 com.qklab.appium.Initiator$1 run - APPIUM: [UiAutomator2] Running command: 'adb -s df7cc4df shell am instrument -w io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner' [DEBUG] 2017-12-13 13:17:23,377 com.qklab.appium.Initiator$1 run - APPIUM: [UiAutomator2] Waiting up to 20000ms for UiAutomator2 to be online... [DEBUG] 2017-12-13 13:17:23,378 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:41274/wd/hub/status] with no body [DEBUG] 2017-12-13 13:17:24,398 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:41274/wd/hub/status] with no body [DEBUG] 2017-12-13 13:17:25,402 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:41274/wd/hub/status] with no body [DEBUG] 2017-12-13 13:17:26,408 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:41274/wd/hub/status] with no body [DEBUG] 2017-12-13 13:17:27,411 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:41274/wd/hub/status] with no body [DEBUG] 2017-12-13 13:17:28,414 com.qklab.appium.Initiator$1 run - APPIUM: [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:41274/wd/hub/status] with no body

start appium with automationName=uiautomator2, pressKeyCode() doesn't work!

when i use automationName=uiautomator2 in my desired capabilities, then the pressKeyCode method doesn't work, and appium server without any error message.

when i change the desired capabilities with automationName=Appium and restart my project, pressKeyCode method will be work fine.

I have no idea on this, wish reply! thanks



appium server : v1.7.3

<dependency>
      <groupId>io.appium</groupId>
      <artifactId>java-client</artifactId>
      <version>5.0.4</version>
</dependency>

  • property in the desired capabilities
serverURL=http://127.0.0.1:4723/wd/hub
automationName=uiautomator2
platformName=Android
platformVersion=5.1.1
deviceName=vivo X6SPlus D
  • pressKeyCode method
    public void keyboardSearch() {
        AndroidDriver androidDriver = convertAndroidDriver();
        if (androidDriver != null) {
            androidDriver.pressKeyCode(AndroidKeyCode.ENTER);
        }
    } 
  • appium server logs
[2018-03-13 08:26:30][HTTP] <-- POST /wd/hub/session/2551ef26-f71b-4eb6-89a7-a05f72c10ee4/element/49329a07-179f-4759-843c-da9b9a1d21dd/value 200 67 ms - 74 
[2018-03-13 08:26:30][HTTP] --> POST /wd/hub/session/2551ef26-f71b-4eb6-89a7-a05f72c10ee4/appium/device/press_keycode {"keycode":66}
[2018-03-13 08:26:30][MJSONWP] Calling AppiumDriver.pressKeyCode() with args: [66,null,null,null,"2551ef26-f71b-4eb6-89a7-a05f72c10ee4"]
[2018-03-13 08:26:30][JSONWP Proxy] Proxying [POST /appium/device/press_keycode] to [POST http://localhost:8206/wd/hub/session/b5441807-e0eb-482e-ab5e-02ffe7c6b0d3/appium/device/press_keycode] with body: {"keycode":66,"metastate":null}
[2018-03-13 08:26:32][JSONWP Proxy] Got response with status 200: {"sessionId":"b5441807-e0eb-482e-ab5e-02ffe7c6b0d3","status":0,"value":true}
[2018-03-13 08:26:32][MJSONWP] Responding to client with driver.pressKeyCode() result: true
[2018-03-13 08:26:32][HTTP] <-- POST /wd/hub/session/2551ef26-f71b-4eb6-89a7-a05f72c10ee4/appium/device/press_keycode 200 616 ms - 76 
[2018-03-13 08:27:28][BaseDriver] Shutting down because we waited 60 seconds for a command
[2018-03-13 08:27:28][UiAutomator2] Deleting UiAutomator2 session
[2018-03-13 08:27:28][Appium] Closing session, cause was 'New Command Timeout of 60 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability'
[2018-03-13 08:27:28][Appium] Removing session 2551ef26-f71b-4eb6-89a7-a05f72c10ee4 from our master session list

How to get the url of WebView?

There are multiple WebViews in an Activity and I want to know which URL/context corresponds to the WebView I selected. Is that possible?

The target element can not be location correctly after scroll the view which contain the target view three times

Problem/Step

Runing test on android real device with uia2,after sroll up list view for many times,find the target element by xpath //*[contains(@content-desc,卖出)], the item view's location is {"x":0,"y":0} and size is {"width":1080,"height":1920}, this is the phone's location and size not this element.

Firstly, Scroll up list view for three times,
Secondly, click a item in the list view, there will be three child item show
Finally, click one child item

Log

uia2 log

screencap

special characters like â cannot be entered it is giving permission error

Getting the below error when I am trying to enter special characters like "â".

[debug] [ADB] Running '/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","ce051605646b143c05","shell","input","text","aaaâ"]
# [MJSONWP] Encountered internal error running command: Error: Error executing adbExec. Original error: 'Command '/Library/Android/sdk/platform-tools/adb -P 5037 -s ce051605646b143c05 shell input text â' exited with code 137'; Stderr: 'sh: resetreason: can't execute: Permission denied'; Code: '137'
at ADB.execFunc$ (../../../lib/tools/system-calls.js:228:13)

at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[HTTP] <-- POST /wd/hub/session/8887e708-05a1-4809-94c1-d842f713b2ca/appium/element/b448c050-c92e-4a8c-a731-cc74155885a5/value 500 1383 ms - 425

false negative when determine isVisibleToUser of an element

When I'm doing some testing, I found the server gives me some log like this:

03-06 05:43:32.020 17429 17579 I appium  : Skipping invisible child: android.view.accessibility.AccessibilityNodeInfo@9c28; boundsInParent: Rect(400, 145 - 745, 205); boundsInScreen: Rect(800, 290 - 1490, 410); packageName: sworkitapp.sworkit.com; className: android.view.View; text: null; error: null; maxTextLength: -1; contentDescription:  通过Facebook登录 ; viewIdResName: null; checkable: false; checked: false; focusable: false; focused: false; selected: false; clickable: false; longClickable: false; contextClickable: false; enabled: true; password: false; scrollable: false; actions: [AccessibilityAction: ACTION_ACCESSIBILITY_FOCUS - null, AccessibilityAction: ACTION_NEXT_AT_MOVEMENT_GRANULARITY - null, AccessibilityAction: ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY - null, AccessibilityAction: ACTION_NEXT_HTML_ELEMENT - null, AccessibilityAction: ACTION_PREVIOUS_HTML_ELEMENT - null]

It says this element is not visible to user so it is skipped. However, this element is visible to user and I need to click it to do facebook login.
Here is the screenshot of uiautomatorviewer
screen shot 2018-03-06 at 7 40 41 pm

The code corresponding to this is

            AccessibilityNodeInfo child = node.getChild(i);
            if (child != null) {
                if (child.isVisibleToUser()) {
                    dumpNodeRec(child, serializer, i, width, height);
                    child.recycle();
                } else {
                    Logger.info(String.format("Skipping invisible child: %s", child.toString()));
                }
            } else {
                Logger.info(String.format("Null child %d/%d, parent: %s", i, count, node.toString()));
            }

in /app/src/main/java/io/appium/uiautomator2/core/AccessibilityNodeInfoDumper.java

I know this may be out of scope of what this project can handle to fix isVisibleToUser
But I wonder whether we could make it configurable to judge whether to skip invisible children or not?

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Enable travis-ci

Now the project has .tavis.yml config and unit && e2e tests can be run on travis.

Strange! getPageSource return different hierarchy on same webview page

Enviroments: Appium 1.6.5 + appium-uiautomator2-server 0.1.8 + uiautomator2

second time return details about webview, that is what I expect:
image

then I use the UiDevice APi dumpWindowHierarchy, the same results as above

ByteArrayOutputStream baos = new ByteArrayOutputStream();
            getUiDevice().dumpWindowHierarchy(baos);

So can anybody tell me the reason? Is it a Bug of Android or some features of Webview make this happen? Much thanks!

Inconsistency between appium-android-bootstrap and appium-uiautomator2-server when search element by id without specifying package name.

Currently appium-android-bootstrap tries to locate element by id (when package name is not specified) with android package, e.g. android:id/my_id:
appium/appium#4467

But appium-uiautomator2-server searchs only with default package name.

In some cases it is difficult to understand why an element can be located with a uiautomator and can not be found with uiautomator2.

It also makes migration to uiautomator2 more complex.

From element, could not getting value of "checked" attribute.

Hello, I have trouble with getting attribute from element.

My environment : Android 6.0, Appium 1.6.3, uiautomator2

I tired to get value of "checked" attribute of CheckBox widget, but had error.

Here is my python code.

el = self.driver.find_element_by_xpath("")
logger.info(el.get_attribute("checked") )

and the error

....
File ".../venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 144,
in get_attribute if name != 'value' and attributeValue.lower() in ('true', 'false'): 
AttributeError: 'bool' object has no attribute 'lower'
....

So, I patched webelement.py file and it seems working now.
However, I don't know where to report this problem to fix this error.
Should I report this to selenium? or is uiautomator2 sends boolean value?

Please check this issue out.
Thank you!

Bad call: specified package io.appium.uiautomator2.server.test

In our acceptance tests we randomly encounter the following exception. After appium has crashed, our app crashed too.

09-25 12:40:02.745  1000  1604  1667 D VoldConnector: RCV <- {200 44 Command succeeded}
09-25 12:40:02.792  1000  1604  1604 I Telecom : DefaultDialerCache: Refreshing default dialer for user 0: now com.google.android.dialer: DDC.oR@AP8
09-25 12:40:02.836  1000  1604  5690 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.sheypoor.mobile.debug flg=0x4000010 (has extras) } to com.google.android.googlequicksearchbox/com.google.android.apps.gsa.googlequicksearchbox.GelStubAppWatcher
09-25 12:40:03.024  1000  1604  1826 I ActivityManager: Force stopping io.appium.uiautomator2.server appid=10080 user=0: from pid 9675
09-25 12:40:03.380  1000  1604  1826 I ActivityManager: Force stopping io.appium.uiautomator2.server appid=10080 user=0: start instr
09-25 12:40:03.391  1000  1604  1826 I ActivityManager: Start proc 9687:io.appium.uiautomator2.server/u0a80 for added application io.appium.uiautomator2.server
09-25 12:40:05.473  1000  1604  1826 W AppOps  : Bad call: specified package io.appium.uiautomator2.server.test under uid 10080 but it is really 10081
09-25 12:40:05.473  1000  1604  1826 W AppOps  : java.lang.RuntimeException: here
09-25 12:40:05.473  1000  1604  1826 W AppOps  : 	at com.android.server.AppOpsService.getOpsRawLocked(AppOpsService.java:1322)
09-25 12:40:05.473  1000  1604  1826 W AppOps  : 	at com.android.server.AppOpsService.startOperation(AppOpsService.java:1143)
09-25 12:40:05.473  1000  1604  1826 W AppOps  : 	at com.android.server.power.Notifier.onWakeLockAcquired(Notifier.java:189)
09-25 12:40:05.473  1000  1604  1826 W AppOps  : 	at com.android.server.power.PowerManagerService.notifyWakeLockAcquiredLocked(PowerManagerService.java:1230)
09-25 12:40:05.473  1000  1604  1826 W AppOps  : 	at com.android.server.power.PowerManagerService.acquireWakeLockInternal(PowerManagerService.java:1087)
09-25 12:40:05.473  1000  1604  1826 W AppOps  : 	at com.android.server.power.PowerManagerService.-wrap7(Unknown Source:0)
09-25 12:40:05.473  1000  1604  1826 W AppOps  : 	at com.android.server.power.PowerManagerService$BinderService.acquireWakeLock(PowerManagerService.java:4166)
09-25 12:40:05.473  1000  1604  1826 W AppOps  : 	at android.os.IPowerManager$Stub.onTransact(IPowerManager.java:66)
09-25 12:40:05.473  1000  1604  1826 W AppOps  : 	at android.os.Binder.execTransact(Binder.java:697)

Is there anything that we can do to fix it?

UiSelectorSyntaxException: Could not parse UiSelector argument: UiScrollable has no "scrollIntoView" method that takes 2 arguments

Appium server: 1.7.1
Appium client: wd.js 1.4.1
Env: MacOS Sierra, Android 5.0 emulator, automationName = UiAutomator2

Exception occurs if text contains 2+ commas (e.g. 1,000,000) while trying to call driver.elementByAndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textContains(\"1,000,000\").instance(0))")

Error: [elementByAndroidUIAutomator("new UiScrollable(new UiSelector().
scrollable(true).instance(0)).scrollIntoView(newUiSelector().
textContains(\"1,000,000\").instance(0))")] 
Error response status: 9, , UnknownCommand - The requested resource could not be found,
or a request was received using an HTTP method that is not supported by the mapped
resource.
Selenium error: io.appium.uiautomator2.common.exceptions.UiSelectorSyntaxException:
Could not parse UiSelector argument: UiScrollable has no "scrollIntoView" method
that takes 2 arguments
	at io.appium.uiautomator2.handler.FindElement.findByUiAutomator(FindElement.java:194)
	at io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:155)
	at io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:102)
	at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:56)
	at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:202)
	at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:193)
	at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:514)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:468)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
	at java.lang.Thread.run(Thread.java:818)

Android 8 and uiautomator2 issues.

During performing some tests on new devices with android 8 I've noticed that there is a problem with performing them using uiautomator2. At first I thoguht that it is related to appium-dotnet-driver. But I've reproduced the issue on java-client. The behavior is that on some requests server is hanging. I tried both versions, with click, with touch actions. Nothing is working. Issue has been recreated on appium 1.8.0 and 1.8.1 with uiautomator2 server 1.7.0 and 1.12.0 with same results.

Java-client code:
DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "auto"); capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath()); capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2); AppiumDriver<MobileElement> driver = new AndroidDriver<>( new URL("http://127.0.0.1:4723/wd/hub"), capabilities); MobileElement element = driver.findElementById("android:id/tabs"); final List<MobileElement> elementsByXPath = element.findElementsByXPath("//*"); element.findElementsByXPath("//*").stream().filter((x) -> x.getText().equals("CONTROLS")).findFirst().get().click();

logs from java-client uiautomator2 execution

[HTTP] --> POST /wd/hub/session/5ed3282d-6d05-4ce1-b61c-65e51b56e007/element/160bbe9a-b513-411a-98fe-072e96ee6576/click
[HTTP] {"id":"160bbe9a-b513-411a-98fe-072e96ee6576"}
[debug] [W3C] Calling AppiumDriver.click() with args: ["160bbe9a-b513-411a-98fe-072e96ee6576","5ed3282d-6d05-4ce1-b61c-65e51b56e007"]
[debug] [JSONWP Proxy] Proxying [POST /element/160bbe9a-b513-411a-98fe-072e96ee6576/click] to [POST http://localhost:8200/wd/hub/session/4ad824e3-8852-41ca-922b-c262b248a78d/element/160bbe9a-b513-411a-98fe-072e96ee6576/click] with body: {"element":"160bbe9a-b513-411a-98fe-072e96ee6576"}
[HTTP] <-- POST /wd/hub/session/5ed3282d-6d05-4ce1-b61c-65e51b56e007/element/160bbe9a-b513-411a-98fe-072e96ee6576/click - - ms - -

Logcat device logs
https://gist.github.com/GrzegorzSidwa/20785948221a23e6757ae80557b76c4c

Logcat appium-uiautomator2-server logs
https://gist.github.com/GrzegorzSidwa/0750ace36bcaaf2b3711f1bff92f6aaa

appium-dotnet-driver code
AndroidDriver<AppiumWebElement> driver = new AndroidDriver<AppiumWebElement>(new Uri("http://127.0.0.1:4723/wd/hub"), caps, TimeSpan.FromMinutes(15)); var element = driver.FindElementById(@"android:id/tabs"); var appiumWebElement = element.FindElementsByXPath("//*").FirstOrDefault(x => x.Text == "CONTROLS"); new TouchAction(driver).Press(appiumWebElement).Wait(500).Release().Perform();

logs from appium-dotnet-driver execution

[HTTP] --> POST /wd/hub/session/23a503cc-e4b2-4e48-b750-63e4d362b354/touch/perform
[HTTP] {"actions":[{"action":"press","options":{"element":"dcbad3b6-d315-42f7-a574-8ebb59fead73"}},{"action":"wait","options":{"ms":500}},{"action":"release"}]}
[debug] [W3C] Calling AppiumDriver.performTouch() with args: [[{"action":"press","options":{"element":"dcbad3b6-d315-42f7-a574-8ebb59fead73"}},{"action":"wait","options":{"ms":500}},{"action":"release"}],"23a503cc-e4b2-4e48-b750-63e4d362b354"]
[UiAutomator2] calling get location: dcbad3b6-d315-42f7-a574-8ebb59fead73
[debug] [JSONWP Proxy] Proxying [GET /element/dcbad3b6-d315-42f7-a574-8ebb59fead73/location] to [GET http://localhost:8200/wd/hub/session/b493e649-4d2f-48ca-af88-a3ebacd59f51/element/dcbad3b6-d315-42f7-a574-8ebb59fead73/location] with body: {}

Conclusion
Exactly the same tests executed on device with Android 7 are working correctly.

Sending null as text to SendKeys() results in string "null"

The current code in the appium-uiautomator2-server for SendKeysToElement.java contains this line:

image

JObject.getString(string) returns "null" when given null. So we would expect that there would be a JObject.isNull("text") line (or something like it) preceding it followed by proper handling (perhaps do nothing).

click the same element twice or more, throw a uiautomator exception

when I click the same element twice or more, use two of the same click on the statements, or use the for statement, it will throw a exception.

sometimes before i click the element, use Thread.sleep(1000),it can run success, but sometime it still throw the same exception

appium version:1.6.1
appium-uiautomator2-server version: 0.0.6

org.openqa.selenium.StaleElementReferenceException: android.support.test.uiautomator.StaleObjectException at android.support.test.uiautomator.UiObject2.getAccessibilityNodeInfo(UiObject2.java:629) at android.support.test.uiautomator.UiObject2.getVisibleBounds(UiObject2.java:210) at android.support.test.uiautomator.UiObject2.getVisibleCenter(UiObject2.java:251) at android.support.test.uiautomator.UiObject2.click(UiObject2.java:343) at io.appium.uiautomator2.model.UiObject2Element.click(UiObject2Element.java:42) at io.appium.uiautomator2.handler.Click.safeHandle(Click.java:39) at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:54) at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:201) at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:192) at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611) at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:514) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:468) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140) at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144) at java.lang.Thread.run(Thread.java:818)

use the sendKeys() in uiautomator2 throw nullpointerException

I test the login in app. use the sendKeys()method to send text in a password inputBox. It success in appium(AutomationName) but failed in uiautomator2. And I can use successly the setValue method to send text in this password inputbox by uiautomator2 or appium.

platformVersion:4.4.4

the exception info:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: java.lang.NullPointerException at android.support.test.uiautomator.UiObject2.setText(UiObject2.java:601) at io.appium.uiautomator2.model.UiObject2Element.setText(UiObject2Element.java:128) at io.appium.uiautomator2.handler.SendKeysToElement.safeHandle(SendKeysToElement.java:83) at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:54) at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:201) at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:192) at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611) at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:514) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:468) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140) at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144) at java.lang.Thread.run(Thread.java:841) (WARNING: The server did not provide any stacktrace information)

Returning boolean value in get element atrribute

Hi folks,
I have a question regarding this:
https://github.com/appium/appium-uiautomator2-server/blob/master/app/src/main/java/io/appium/uiautomator2/handler/GetElementAttribute.java#L41

I've seen some problems with UIAUTOMATOR2 returning bool instead of string (it was causing python webdriver bindings to crash).
According to spec bool attributes should be return as strings as well:
https://w3c.github.io/webdriver/webdriver-spec.html#get-element-attribute

13.2 Get Element Attribute
...
If name is a boolean attribute
"true" (string) if the element has the attribute, otherwise null.

Otherwise
The result of getting an attribute by name name.

Should this be fixed?

UiAutomator2 - Cannot read manifest information error

I use windows 7 x64 installed latest node.js and npm

I synced latest [email protected]

I got some hint on website to use uiautomator2 in appium to test android devices. so when I add capability uiautomator2 , it is throwing below error in script

Error:
‘An unknown server-side error occurred while processing the command. Original error: Cannot read manifest information from ‘C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\uiautomator2\appium-uiautomator2-server-v0.1.9.apk’. Does the package exist and is accessible?’

in Appium logs i see below traces:
2017-11-07 19:58:53:703 - info: [debug] [ADB] Checking app cert for C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\uiautomator2\appium-uiautomator2-server-v0.1.9.apk.
2017-11-07 19:58:53:912 - info: [debug] [ADB] App not signed with debug cert.
2017-11-07 19:58:53:913 - info: [debug] [ADB] Resigning apk.
2017-11-07 19:58:54:114 - error: [ADB] Error: Could not sign with default certificate. Original error Command ‘‘C:\Program Files\Java\jdk-9\bin\java.exe’ -jar C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\jars\sign.jar C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\uiautomator2\appium-uiautomator2-server-v0.1.9.apk --override’ exited with code 1
at Object.wrappedLogger.errorAndThrow (C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\appium-support\lib\logging.js:69:13)
at ADB.callee$0$0$ (C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\lib\tools\apk-signing.js:25:9)
at tryCatch (C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
Error: Could not sign with default certificate. Original error Command ‘‘C:\Program Files\Java\jdk-9\bin\java.exe’ -jar C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\jars\sign.jar C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\uiautomator2\appium-uiautomator2-server-v0.1.9.apk --override’ exited with code 1
at Object.wrappedLogger.errorAndThrow (C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\appium-support\lib\logging.js:69:13)
at ADB.callee$0$0$ (C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\appium-adb\lib\tools\apk-signing.js:25:9)
at tryCatch (C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (C:\Users\pmaniva\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
2017-11-07 19:58:54:115 - info: [debug] [UiAutomator2] Deleting UiAutomator2 session
2017-11-07 19:58:54:115 - info: [debug] [UiAutomator2] Deleting UiAutomator2 server session
2017-11-07 19:58:54:116 - warn: [UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: Error: Trying to proxy a session command without session id

SendKeys does not 'send keys' but rather sets or appends text

In looking at the source code, this seems like it could be a limitation of the underlying Android classes, but it is certainly not 'sending keys' in the sense of entering them one at a time. This has a real effect on our testing as one thing we are trying to test is whether or not a restriction on number of characters a text box allows is being enforced.

Has there been any consideration for this? A proper sendkeys would be welcome for our team.

Unable to see Toast messages

My application creates a toast message through the system. The toast message is displayed, but cannot be found by the UiAutomator2 server regardless of the search strategy. We need to get this message for our testing.

Latest releases missing appium-uiautomator2-server apk

It looks like the last release that provided an apk was 0.4.1, but there appear to have been quite a few releases since then that only include the code files. Are future releases no longer providing these apks or is 0.4.1 still considered the latest stable, and future stable releases will still include the apk? Thanks!

Supporting android:imeOptions

Is there any possibilities to support to send android:imeOptions below in appium?

actionGo: This displays Go as the Enter key.  Action event is IME_ACTION_GO
actionSearch: Displays a search icon as the Enter key  Action event is IME_ACTION_SEARCH
actionSend: Displays Send as the Enter key. Action event is IME_ACTION_SEND
actionNext: Displays Next as the Enter key. Action event is IME_ACTION_NEXT
actionDone: Displays Done as the Enter key. Action event is IME_ACTION_DONE

At present, If the screen is defined with android:imeOptions="actionNext” then i am able to send "KEYCODE_ENTER" to proceed further.
Example in adb command : adb shell "input keyevent KEYCODE_ENTER"

Incase if the screen is defined with android:imeOptions="actionSearch” Or android:imeOptions="actionDone” then i am unable to proceed further. Hence sending keycodes are not helping trigger the imeOptions events in the background.

I am not getting help from developer also to override onKeyDown in Activity and manually call onEditorAction(EditorInfo.IME_ACTION_DONE) if I send keyevent search or enter.

So looking any possibilities with appium trigger imeOptions?

FYI :

I am using calabash to run compatibility automation with app center(xamarin test cloud), and i am able to trigger any imeOptions events if i mention event like this : press_user_action_button('search')

I am able to relate the code in calabash-android-server that trigger editor option at runtime.
Example :
actionCodeMap = new HashMap<String, Integer>();
        actionCodeMap.put("normal", EditorInfo.IME_ACTION_UNSPECIFIED);
        actionCodeMap.put("unspecified", EditorInfo.IME_ACTION_UNSPECIFIED);
        actionCodeMap.put("none", EditorInfo.IME_ACTION_NONE);
        actionCodeMap.put("go", EditorInfo.IME_ACTION_GO);
        actionCodeMap.put("search", EditorInfo.IME_ACTION_SEARCH);
        actionCodeMap.put("send", EditorInfo.IME_ACTION_SEND);
        actionCodeMap.put("next", EditorInfo.IME_ACTION_NEXT);
        actionCodeMap.put("done", EditorInfo.IME_ACTION_DONE);
        actionCodeMap.put("previous", EditorInfo.IME_ACTION_PREVIOUS);

         inputConnection.performEditorAction(imeActionCode)

Please refer the below link that provides more detail about the code.
https://github.com/calabash/calabash-android-server/blob/720b3f21bd8bd98647157dcdc390730ff2c2cbeb/server/app/src/androidTest/java/sh/calaba/instrumentationbackend/actions/text/PressUserActionButton.java

Failed to capture Screen Shot

public static String screenshot(String filePath) throws JSONException {
JSONObject jsonObject = new JSONObject();
return get(baseUrl + "/screenshot");
}

Unable to find android system resources like statusBarBackground

Hi,
After upgrading Appium from 1.6.3 (uiautomator2-server v0.0.8) to Appium 1.6.5 (uiautomator2-server v0.1.5) I'm unable to find android bars like android:id/statusBarBackground or android:id/navigationBarBackground during my test which requires to interact with this bars.

The commit 5a7adfb cause this behavior.

Should this be fixed? or exposed some settings in appium capabilities to control isVisibleToUser.

The statusBar and navigationBar is displayed and I don't know why android isVisibleToUser decided is not visible.

Appium capability nativeWebScreenshot is ignored when using uiautomator2

When I start appium with the capabilities:

"automationName" : "uiautomator2"
"nativeWebScreenshot" : true

Whenever I am in webview context, it tries to take the screenshot using chromedriver still instead of native adb. It seems like the capability nativeWebScreenshot is not seen by uiautomator2. If I use uiautomator and nativeWebScreenshot is set to true, the screenshot is taken with native adb.

I am using appium 1.6.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.