appium识别到了元素并且发送click事件,但手机没反应

  • Appium version: 1.22.3
  • MacBook Pro (13-inch, M1, 2020)
    *芯片 Apple M1
  • Node.js version: v12.20.0
  • jdk1.8.0_311.jdk

[Appium] Welcome to Appium v1.22.3

[Appium] Non-default server args:

[Appium] port: 4725

[Appium] Appium REST http interface listener started on 0.0.0.0:4725

[debug] [HTTP] Request idempotency key: bd30eadb-b701-427c-9c66-41619be680ab

[HTTP] → POST /wd/hub/session

[HTTP] {“capabilities”:{“firstMatch”:[{“platformName”:“Android”,“appium:deviceName”:“VWS0220318007237”,“appium:platformVersion”:“10”,“appium:appPackage”:“com.tencent.wework”,“appium:appActivity”:".launch.LaunchSplashActivity",“appium:skipDeviceInitialization”:true,“appium:noReset”:true,“appium:settings[waitForIdleTimeout]”:10}]},“desiredCapabilities”:{“platformName”:“Android”,“deviceName”:“VWS0220318007237”,“platformVersion”:“10”,“appPackage”:“com.tencent.wework”,“appActivity”:".launch.LaunchSplashActivity",“skipDeviceInitialization”:true,“noReset”:true,“settings[waitForIdleTimeout]”:10}}

[debug] [W3C] Calling AppiumDriver.createSession() with args: [{“platformName”:“Android”,“deviceName”:“VWS0220318007237”,“platformVersion”:“10”,“appPackage”:“com.tencent.wework”,“appActivity”:".launch.LaunchSplashActivity",“skipDeviceInitialization”:true,“noReset”:true,“settings[waitForIdleTimeout]”:10},null,{“firstMatch”:[{“platformName”:“Android”,“appium:deviceName”:“VWS0220318007237”,“appium:platformVersion”:“10”,“appium:appPackage”:“com.tencent.wework”,“appium:appActivity”:".launch.LaunchSplashActivity",“appium:skipDeviceInitialization”:true,“appium:noReset”:true,“appium:settings[waitForIdleTimeout]”:10}]}]

[debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1648190894437 (14:48:14 GMT+0800 (GMT+08:00))

[Appium]

[Appium] ======================================================================

[Appium] DEPRECATION WARNING:

[Appium]

[Appium] The ‘automationName’ capability was not provided in the desired

[Appium] capabilities for this Android session

[Appium]

[Appium] Setting ‘automationName=UiAutomator2’ by default and using the

[Appium] UiAutomator2 Driver

[Appium]

[Appium] The next major version of Appium (2.x) will require the

[Appium] ‘automationName’ capability to be set for all sessions on all

[Appium] platforms

[Appium]

[Appium] In previous versions (Appium <= 1.13.x), the default was

[Appium] ‘automationName=UiAutomator1’

[Appium]

[Appium] If you wish to use that automation instead of UiAutomator2, please

[Appium] add ‘automationName=UiAutomator1’ to your desired capabilities

[Appium]

[Appium] For more information about drivers, please visit

[Appium] Introduction - Appium and explore the

[Appium] ‘Drivers’ menu

[Appium]

[Appium] ======================================================================

[Appium]

[Appium] Appium v1.22.3 creating new AndroidUiautomator2Driver (v1.70.1) session

[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided

[debug] [BaseDriver] Creating session with W3C capabilities: {

[debug] [BaseDriver] “alwaysMatch”: {

[debug] [BaseDriver] “platformName”: “Android”,

[debug] [BaseDriver] “appium:deviceName”: “VWS0220318007237”,

[debug] [BaseDriver] “appium:platformVersion”: “10”,

[debug] [BaseDriver] “appium:appPackage”: “com.tencent.wework”,

[debug] [BaseDriver] “appium:appActivity”: “.launch.LaunchSplashActivity”,

[debug] [BaseDriver] “appium:skipDeviceInitialization”: true,

[debug] [BaseDriver] “appium:noReset”: true

[debug] [BaseDriver] },

[debug] [BaseDriver] “firstMatch”: [

[debug] [BaseDriver] {}

[debug] [BaseDriver] ]

[debug] [BaseDriver] }

[BaseDriver] Session created with session id: 8aee14bc-181f-4c27-898a-d054e05baf5e

[UiAutomator2] Starting ‘com.tencent.wework’ directly on the device

[ADB] Found 1 ‘build-tools’ folders under ‘/Users/fin-13928/Library/Android/sdk’ (newest first):

[ADB] /Users/fin-13928/Library/Android/sdk/build-tools/33.0.0-rc2

[ADB] Using ‘adb’ from ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb’

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 start-server’

[AndroidDriver] Retrieving device list

[debug] [ADB] Trying to find a connected android device

[debug] [ADB] Getting connected devices

[debug] [ADB] Connected devices: [{“udid”:“VWS0220318007237”,“state”:“device”}]

[AndroidDriver] Looking for a device with Android ‘10.0.0’

[debug] [ADB] Setting device id to VWS0220318007237

[ADB] Getting device platform version

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell getprop ro.build.version.release’

[debug] [ADB] Current device property ‘ro.build.version.release’: 10

[AndroidDriver] Using device: VWS0220318007237

[ADB] Using ‘adb’ from ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb’

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 start-server’

[debug] [ADB] Setting device id to VWS0220318007237

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell getprop ro.build.version.sdk’

[debug] [ADB] Current device property ‘ro.build.version.sdk’: 29

[ADB] Getting device platform version

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell getprop ro.build.version.release’

[debug] [ADB] Current device property ‘ro.build.version.release’: 10

[debug] [ADB] Device API level: 29

[UiAutomator2] Relaxing hidden api policy

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell ‘settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1’’

[AndroidDriver] No app sent in, not parsing package/activity

[AndroidDriver] ‘skipDeviceInitialization’ is set. Skipping device initialization.

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell appops set io.appium.settings android:mock_location allow’

[debug] [Logcat] Starting logs capture with command: /Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 logcat -v threadtime

[debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to local port 8207

[debug] [ADB] Forwarding system: 8207 to device: 6790

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 forward tcp:8207 tcp:6790’

[debug] [ADB] Getting install status for io.appium.uiautomator2.server

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell dumpsys package io.appium.uiautomator2.server’

[debug] [ADB] ‘io.appium.uiautomator2.server’ is installed

[debug] [ADB] Getting package info for ‘io.appium.uiautomator2.server’

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell dumpsys package io.appium.uiautomator2.server’

[debug] [ADB] The version name of the installed ‘io.appium.uiautomator2.server’ is greater or equal to the application version name (‘4.27.0’ >= ‘4.27.0’)

[debug] [UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled

[debug] [ADB] Checking app cert for /opt/homebrew/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.27.0.apk

[ADB] Using ‘apksigner.jar’ from ‘/Users/fin-13928/Library/Android/sdk/build-tools/33.0.0-rc2/lib/apksigner.jar’

[debug] [ADB] Starting apksigner: /Library/Java/JavaVirtualMachines/jdk1.8.0_311.jdk/Contents/Home/bin/java -Xmx1024M -Xss1m -jar /Users/fin-13928/Library/Android/sdk/build-tools/33.0.0-rc2/lib/apksigner.jar verify --print-certs /opt/homebrew/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.27.0.apk

[debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US

[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc

[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81

[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87

[debug] [ADB]

[debug] [ADB] sha256 hash did match for ‘appium-uiautomator2-server-v4.27.0.apk’

[ADB] ‘/opt/homebrew/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.27.0.apk’ is signed with the default certificate

[debug] [ADB] Getting install status for io.appium.uiautomator2.server.test

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell dumpsys package io.appium.uiautomator2.server.test’

[debug] [ADB] ‘io.appium.uiautomator2.server.test’ is installed

[debug] [ADB] Checking app cert for /opt/homebrew/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk

[debug] [ADB] Starting apksigner: /Library/Java/JavaVirtualMachines/jdk1.8.0_311.jdk/Contents/Home/bin/java -Xmx1024M -Xss1m -jar /Users/fin-13928/Library/Android/sdk/build-tools/33.0.0-rc2/lib/apksigner.jar verify --print-certs /opt/homebrew/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk

[debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US

[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc

[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81

[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87

[debug] [ADB]

[debug] [ADB] sha256 hash did match for ‘appium-uiautomator2-server-debug-androidTest.apk’

[ADB] ‘/opt/homebrew/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk’ is signed with the default certificate

[UiAutomator2] Server packages are not going to be (re)installed

[debug] [UiAutomator2] Waiting up to 30000ms for services to be available

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell pm list instrumentation’

[debug] [UiAutomator2] Instrumentation target ‘io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner’ is available

[ADB] Adding packages [“io.appium.settings”,“io.appium.uiautomator2.server”,“io.appium.uiautomator2.server.test”] to Doze whitelist

[debug] [ADB] Got the following command chunks to execute: [[“dumpsys”,“deviceidle”,“whitelist”,"+io.appium.settings",";",“dumpsys”,“deviceidle”,“whitelist”,"+io.appium.uiautomator2.server",";",“dumpsys”,“deviceidle”,“whitelist”,"+io.appium.uiautomator2.server.test",";"]]

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server.test ;’

[debug] [UiAutomator2] No app capability. Assuming it is already on the device

[debug] [UiAutomator2] Performing shallow cleanup of automation leftovers

[debug] [UiAutomator2] No obsolete sessions have been detected (timeout of 500ms exceeded)

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell am force-stop io.appium.uiautomator2.server.test’

[UiAutomator2] Starting UIAutomator2 server 4.27.0

[UiAutomator2] Using UIAutomator2 server from ‘/opt/homebrew/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.27.0.apk’ and test from ‘/opt/homebrew/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk’

[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online…

[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s",“VWS0220318007237”,“shell”,“am”,“instrument”,"-w","-e",“disableAnalytics”,true,“io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner”]

[debug] [WD Proxy] Matched ‘/status’ to command name ‘getStatus’

[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8207/wd/hub/status] with no body

[WD Proxy] socket hang up

[debug] [Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:

[debug] [WD Proxy] Matched ‘/status’ to command name ‘getStatus’

[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8207/wd/hub/status] with no body

[WD Proxy] socket hang up

[debug] [WD Proxy] Matched ‘/status’ to command name ‘getStatus’

[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8207/wd/hub/status] with no body

[debug] [WD Proxy] Got response with status 200: {“sessionId”:“None”,“value”:{“message”:“UiAutomator2 Server is ready to accept commands”,“ready”:true}}

[debug] [UiAutomator2] The initialization of the instrumentation process took 2440ms

[debug] [WD Proxy] Matched ‘/session’ to command name ‘createSession’

[debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8207/wd/hub/session] with body: {“capabilities”:{“firstMatch”:[{“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platformName”:“Android”,“deviceName”:“VWS0220318007237”,“platformVersion”:“10”,“appPackage”:“com.tencent.wework”,“appActivity”:".launch.LaunchSplashActivity",“skipDeviceInitialization”:true,“noReset”:true},“platformName”:“Android”,“deviceName”:“VWS0220318007237”,“platformVersion”:“10”,“appPackage”:“com.tencent.wework”,“appActivity”:".launch.LaunchSplashActivity",“skipDeviceInitialization”:true,“noReset”:true,“deviceUDID”:“VWS0220318007237”}],“alwaysMatch”:{}}}

[debug] [WD Proxy] Got response with status 200: {“sessionId”:“041dd1a0-8b33-412f-aeb0-c998ebbfd7cf”,“value”:{“capabilities”:{“firstMatch”:[{“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platformName”:“Android”,“deviceName”:“VWS0220318007237”,“platformVersion”:“10”,“appPackage”:“com.tencent.wework”,“appActivity”:".launch.LaunchSplashActivity",“skipDeviceInitialization”:true,“noReset”:true},“platformName”:“Android”,“deviceName”:“VWS0220318007237”,“platformVersion”:“10”,“appPackage”:“com.tencent.wework”,“appActivity”:".launch.LaunchSplashActivity",“skipDeviceInitialization”:true,“noReset”:true,“deviceUDID”:“VWS0220318007237”}],“alwaysMatch”:{}},“sessionId”:“041dd1a0-8b33-412f-aeb0-c998ebbfd7cf”}}

[WD Proxy] Determined the downstream protocol as ‘W3C’

[debug] [WD Proxy] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8207/wd/hub/session/041dd1a0-8b33-412f-aeb0-c998ebbfd7cf/appium/device/info] with no body

[debug] [WD Proxy] Got response with status 200: {“sessionId”:“041dd1a0-8b33-412f-aeb0-c998ebbfd7cf”,“value”:{“androidId”:“6963101d5e2e4ca6”,“apiVersion”:“29”,“bluetooth”:{“state”:“OFF”},“brand”:“HUAWEI”,“carrierName”:"",“displayDensity”:480,“locale”:“zh_CN_#Hans”,“manufacturer”:“HUAWEI”,“model”:“ANA-NX9”,“networks”:[{“capabilities”:{“SSID”:null,“linkDownBandwidthKbps”:1048576,“linkUpstreamBandwidthKbps”:1048576,“networkCapabilities”:“NET_CAPABILITY_NOT_METERED,NET_CAPABILITY_INTERNET,NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_VALIDATED,NET_CAPABILITY_NOT_ROAMING,NET_CAPABILITY_FOREGROUND,NET_CAPABILITY_NOT_CONGESTED,NET_CAPABILITY_NOT_SUSPENDED”,“signalStrength”:-39,“transportTypes”:“TRANSPORT_WIFI”},“detailedState”:“CONNECTED”,“extraInfo”:null,“isAvailable”:true,“isConnected”:true,“isFailover”:false,“isRoaming”:false,“state”:“CONNECTED”,“subtype”:0,“subtypeName”:"",“type”:1,“typeName”:“WIFI”}],“platformVersion”:“10”,“realDisplaySize”:“1080x2340”,“timeZone”:“Asia/Shanghai”}}

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell dumpsys window’

[AndroidDriver] Screen already unlocked, doing nothing

[UiAutomator2] Starting 'com.tencent.wework/.launch.LaunchSplashActivity and waiting for ‘com.tencent.wework/.launch.LaunchSplashActivity’

[debug] [ADB] Running ‘/Users/fin-13928/Library/Android/sdk/platform-tools/adb -P 5037 -s VWS0220318007237 shell am start -W -n com.tencent.wework/.launch.LaunchSplashActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’

[debug] [WD Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8207/wd/hub/session/041dd1a0-8b33-412f-aeb0-c998ebbfd7cf/appium/device/pixel_ratio] with no body

[debug] [WD Proxy] Got response with status 200: {“sessionId”:“041dd1a0-8b33-412f-aeb0-c998ebbfd7cf”,“value”:3}

[debug] [WD Proxy] Matched ‘/appium/device/system_bars’ to command name ‘getSystemBars’

[debug] [WD Proxy] Proxying [GET /appium/device/system_bars] to [GET http://127.0.0.1:8207/wd/hub/session/041dd1a0-8b33-412f-aeb0-c998ebbfd7cf/appium/device/system_bars] with no body

[debug] [WD Proxy] Got response with status 200: {“sessionId”:“041dd1a0-8b33-412f-aeb0-c998ebbfd7cf”,“value”:{“statusBar”:129}}

[debug] [WD Proxy] Matched ‘/window/current/size’ to command name ‘getWindowSize’

[debug] [WD Proxy] Proxying [GET /window/current/size] to [GET http://127.0.0.1:8207/wd/hub/session/041dd1a0-8b33-412f-aeb0-c998ebbfd7cf/window/current/size] with no body

[debug] [WD Proxy] Got response with status 200: {“sessionId”:“041dd1a0-8b33-412f-aeb0-c998ebbfd7cf”,“value”:{“height”:2211,“width”:1080}}

[Appium] New AndroidUiautomator2Driver session created successfully, session 8aee14bc-181f-4c27-898a-d054e05baf5e added to master session list

[Appium] Applying the initial values to Appium settings parsed from W3C caps: {“waitForIdleTimeout”:10}

[UiAutomator2] Forwarding the following settings to the UiAutomator2 server: [“waitForIdleTimeout”]

[debug] [WD Proxy] Matched ‘/appium/settings’ to command name ‘updateSettings’

[debug] [WD Proxy] Proxying [POST /appium/settings] to [POST http://127.0.0.1:8207/wd/hub/session/041dd1a0-8b33-412f-aeb0-c998ebbfd7cf/appium/settings] with body: {“settings”:{“waitForIdleTimeout”:10}}

[debug] [WD Proxy] Got response with status 200: {“sessionId”:“041dd1a0-8b33-412f-aeb0-c998ebbfd7cf”,“value”:null}

[debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1648190902536 (14:48:22 GMT+0800 (GMT+08:00))

[debug] [W3C (8aee14bc)] Cached the protocol value ‘W3C’ for the new session 8aee14bc-181f-4c27-898a-d054e05baf5e

[debug] [W3C (8aee14bc)] Responding to client with driver.createSession() result: {“capabilities”:{“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platformName”:“Android”,“deviceName”:“VWS0220318007237”,“platformVersion”:“10”,“appPackage”:“com.tencent.wework”,“appActivity”:".launch.LaunchSplashActivity",“skipDeviceInitialization”:true,“noReset”:true},“platformName”:“Android”,“deviceName”:“VWS0220318007237”,“platformVersion”:“10”,“appPackage”:“com.tencent.wework”,“appActivity”:".launch.LaunchSplashActivity",“skipDeviceInitialization”:true,“noReset”:true,“deviceUDID”:“VWS0220318007237”,“deviceApiLevel”:29,“deviceScreenSize”:“1080x2340”,“deviceScreenDensity”:480,“deviceModel”:“ANA-NX9”,“deviceManufacturer”:“HUAWEI”,“pixelRatio”:3,“statBarHeight”:129,“viewportRect”:{“left”:0,“top”:129,“width”:1080,“height”:2082}}}

[HTTP] ← POST /wd/hub/session 200 8105 ms - 958

[HTTP]

[HTTP] → POST /wd/hub/session/8aee14bc-181f-4c27-898a-d054e05baf5e/timeouts

[HTTP] {“implicit”:5000}

[debug] [W3C (8aee14bc)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,5000,“8aee14bc-181f-4c27-898a-d054e05baf5e”]

[debug] [BaseDriver] W3C timeout argument: {“implicit”:5000}}

[debug] [BaseDriver] Set implicit wait to 5000ms

[debug] [W3C (8aee14bc)] Responding to client with driver.timeouts() result: null

[HTTP] ← POST /wd/hub/session/8aee14bc-181f-4c27-898a-d054e05baf5e/timeouts 200 8 ms - 14

[HTTP]

[HTTP] → POST /wd/hub/session/8aee14bc-181f-4c27-898a-d054e05baf5e/element

[HTTP] {“using”:“xpath”,“value”:"//*[@text=‘通讯录’]"}

[debug] [W3C (8aee14bc)] Calling AppiumDriver.findElement() with args: [“xpath”,"//*[@text=‘通讯录’]",“8aee14bc-181f-4c27-898a-d054e05baf5e”]

[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, css selector, -android uiautomator

[debug] [BaseDriver] Waiting up to 5000 ms for condition

[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’

[debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8207/wd/hub/session/041dd1a0-8b33-412f-aeb0-c998ebbfd7cf/element] with body: {“strategy”:“xpath”,“selector”:"//*[@text=‘通讯录’]",“context”:"",“multiple”:false}

[debug] [WD Proxy] Got response with status 200: {“sessionId”:“041dd1a0-8b33-412f-aeb0-c998ebbfd7cf”,“value”:{“ELEMENT”:“00000000-0000-04cd-ffff-ffff000000b3”,“element-6066-11e4-a52e-4f735466cecf”:“00000000-0000-04cd-ffff-ffff000000b3”}}

[debug] [W3C (8aee14bc)] Responding to client with driver.findElement() result: {“element-6066-11e4-a52e-4f735466cecf”:“00000000-0000-04cd-ffff-ffff000000b3”,“ELEMENT”:“00000000-0000-04cd-ffff-ffff000000b3”}

[HTTP] ← POST /wd/hub/session/8aee14bc-181f-4c27-898a-d054e05baf5e/element 200 450 ms - 137

[HTTP]

[HTTP] → POST /wd/hub/session/8aee14bc-181f-4c27-898a-d054e05baf5e/element/00000000-0000-04cd-ffff-ffff000000b3/click

[HTTP] {“id”:“00000000-0000-04cd-ffff-ffff000000b3”}

[debug] [W3C (8aee14bc)] Calling AppiumDriver.click() with args: [“00000000-0000-04cd-ffff-ffff000000b3”,“8aee14bc-181f-4c27-898a-d054e05baf5e”]

[debug] [WD Proxy] Matched ‘/element/00000000-0000-04cd-ffff-ffff000000b3/click’ to command name ‘click’

[debug] [WD Proxy] Proxying [POST /element/00000000-0000-04cd-ffff-ffff000000b3/click] to [POST http://127.0.0.1:8207/wd/hub/session/041dd1a0-8b33-412f-aeb0-c998ebbfd7cf/element/00000000-0000-04cd-ffff-ffff000000b3/click] with body: {“element”:“00000000-0000-04cd-ffff-ffff000000b3”}

[debug] [WD Proxy] Got response with status 200: {“sessionId”:“041dd1a0-8b33-412f-aeb0-c998ebbfd7cf”,“value”:null}

[debug] [W3C (8aee14bc)] Responding to client with driver.click() result: null

[HTTP] ← POST /wd/hub/session/8aee14bc-181f-4c27-898a-d054e05baf5e/element/00000000-0000-04cd-ffff-ffff000000b3/click 200 755 ms - 14

[HTTP]

[HTTP] → POST /wd/hub/session/8aee14bc-181f-4c27-898a-d054e05baf5e/element

[HTTP] {“using”:“xpath”,“value”:"//*[@text=‘添加成员’]"}

[debug] [W3C (8aee14bc)] Calling AppiumDriver.findElement() with args: [“xpath”,"//*[@text=‘添加成员’]",“8aee14bc-181f-4c27-898a-d054e05baf5e”]

[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, css selector, -android uiautomator

[debug] [BaseDriver] Waiting up to 5000 ms for condition

[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’

[debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8207/wd/hub/session/041dd1a0-8b33-412f-aeb0-c998ebbfd7cf/element] with body: {“strategy”:“xpath”,“selector”:"//*[@text=‘添加成员’]",“context”:"",“multiple”:false}

[debug] [WD Proxy] Got response with status 200: {“sessionId”:“041dd1a0-8b33-412f-aeb0-c998ebbfd7cf”,“value”:{“ELEMENT”:“00000000-0000-04cd-ffff-ffff000001ee”,“element-6066-11e4-a52e-4f735466cecf”:“00000000-0000-04cd-ffff-ffff000001ee”}}

[debug] [W3C (8aee14bc)] Responding to client with driver.findElement() result: {“element-6066-11e4-a52e-4f735466cecf”:“00000000-0000-04cd-ffff-ffff000001ee”,“ELEMENT”:“00000000-0000-04cd-ffff-ffff000001ee”}

[HTTP] ← POST /wd/hub/session/8aee14bc-181f-4c27-898a-d054e05baf5e/element 200 222 ms - 137

[HTTP]

[HTTP] → POST /wd/hub/session/8aee14bc-181f-4c27-898a-d054e05baf5e/element/00000000-0000-04cd-ffff-ffff000001ee/click

[HTTP] {“id”:“00000000-0000-04cd-ffff-ffff000001ee”}

[debug] [W3C (8aee14bc)] Calling AppiumDriver.click() with args: [“00000000-0000-04cd-ffff-ffff000001ee”,“8aee14bc-181f-4c27-898a-d054e05baf5e”]

[debug] [WD Proxy] Matched ‘/element/00000000-0000-04cd-ffff-ffff000001ee/click’ to command name 'click’

[debug] [WD Proxy] Proxying [POST /element/00000000-0000-04cd-ffff-ffff000001ee/click] to [POST http://127.0.0.1:8207/wd/hub/session/041dd1a0-8b33-412f-aeb0-c998ebbfd7cf/element/00000000-0000-04cd-ffff-ffff000001ee/click] with body: {“element”:“00000000-0000-04cd-ffff-ffff000001ee”}

[HTTP] ← POST /wd/hub/session/8aee14bc-181f-4c27-898a-d054e05baf5e/element/00000000-0000-04cd-ffff-ffff000001ee/click - - ms - -

[HTTP]

[WD Proxy] Error: timeout of 240000ms exceeded

[WD Proxy] at createError (/opt/homebrew/lib/node_modules/appium/node_modules/axios/lib/core/createError.js:16:15)

[WD Proxy] at RedirectableRequest.handleRequestTimeout (/opt/homebrew/lib/node_modules/appium/node_modules/axios/lib/adapters/http.js:280:16)

[WD Proxy] at RedirectableRequest.emit (events.js:314:20)

[WD Proxy] at Timeout._onTimeout (/opt/homebrew/lib/node_modules/appium/node_modules/follow-redirects/index.js:166:12)

[WD Proxy] at listOnTimeout (internal/timers.js:554:17)

[WD Proxy] at processTimers (internal/timers.js:497:7)

[debug] [W3C (8aee14bc)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded

[debug] [W3C (8aee14bc)] at UIA2Proxy.command (/opt/homebrew/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:274:13)

[debug] [W3C (8aee14bc)] at runMicrotasks ()

[debug] [W3C (8aee14bc)] at processTicksAndRejections (internal/process/task_queues.js:97:5)

点击的时候超时了,这个问题的确挺奇怪,你多试几次试试。如果真的是底层的uiautomator没点击成功,你们问题修改起来会棘手些。

adb logcat -s "appium:*" 可以查看底层的报错信息

思寒老师,用 adb logcat -s “appium:*” 查看了底层日志,收到click指令,但手机没有任何动作


image
adb logcat -s "appium:*"文字版日志
fin-13928@fin-13928deMacBook-Pro ~ % adb logcat -s "appium:
"
--------- beginning of crash
--------- beginning of system
--------- beginning of main
03-26 16:51:29.572 6442 6465 I appium : [AppiumUiAutomator2Server] Starting Server
03-26 16:51:30.573 6442 6465 I appium : Starting MJPEG Server
03-26 16:51:30.644 6442 6465 I appium : MJPEG Server started
03-26 16:51:30.650 6442 6469 I appium : ServerSocket created on port 7810
03-26 16:51:30.685 6442 6465 I appium : AndroidServer created on port 6790
03-26 16:51:30.686 6442 6465 I appium : io.appium.uiautomator2.server started:
03-26 16:51:30.700 6442 6472 I appium : Started UiAutomator2 io.appium.uiautomator2.http io.appium.uiautomator2.server on port 6790
03-26 16:51:31.302 6442 6476 I appium : channel read: GET /wd/hub/status
03-26 16:51:31.304 6442 6476 I appium : Status command
03-26 16:51:31.330 6442 6476 I appium : AppiumResponse: {“sessionId”:“None”,“value”:{“message”:“UiAutomator2 Server is ready to accept commands”,“ready”:true}}
03-26 16:51:31.359 6442 6476 I appium : channel read: POST /wd/hub/session
03-26 16:51:31.360 6442 6476 I appium : NewSession command
03-26 16:51:31.372 6442 6476 I appium : Created the new session with SessionID: 5dc51c59-cc13-4679-9a27-41c8ba1f8eef
03-26 16:51:31.382 6442 6476 I appium : AppiumResponse: {“sessionId”:“5dc51c59-cc13-4679-9a27-41c8ba1f8eef”,“value”:{“capabilities”:{“firstMatch”:[{“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{"pl…
03-26 16:51:31.451 6442 6476 I appium : channel read: GET /wd/hub/session/5dc51c59-cc13-4679-9a27-41c8ba1f8eef/appium/device/info
03-26 16:51:31.457 6442 6476 I appium : GetDeviceInfo command
03-26 16:51:31.538 6442 6476 I appium : AppiumResponse: {“sessionId”:“5dc51c59-cc13-4679-9a27-41c8ba1f8eef”,“value”:{“androidId”:“927b01978c39f5bc”,“apiVersion”:“28”,“bluetooth”:{“state”:“OFF”},“brand”:“HUAWEI”,“carrierName”:“中国电信”,“displayDensity”:480,“locale”:“zh_CN_#Hans”,“manufacturer”:“HUAWEI”,“model”:“EML-L29”,“networks”:[{“capabilities”:{“SSID”:nu…
03-26 16:51:34.372 6442 6476 I appium : channel read: GET /wd/hub/session/5dc51c59-cc13-4679-9a27-41c8ba1f8eef/appium/device/pixel_ratio
03-26 16:51:34.373 6442 6476 I appium : GetDevicePixelRatio command
03-26 16:51:34.373 6442 6476 I appium : Get device pixel ratio
03-26 16:51:34.378 6442 6476 I appium : AppiumResponse: {“sessionId”:“5dc51c59-cc13-4679-9a27-41c8ba1f8eef”,“value”:3.0}
03-26 16:51:34.398 6442 6476 I appium : channel read: GET /wd/hub/session/5dc51c59-cc13-4679-9a27-41c8ba1f8eef/appium/device/system_bars
03-26 16:51:34.399 6442 6476 I appium : GetSystemBars command
03-26 16:51:34.399 6442 6476 I appium : Get status bar height of the device
03-26 16:51:34.403 6442 6476 I appium : AppiumResponse: {“sessionId”:“5dc51c59-cc13-4679-9a27-41c8ba1f8eef”,“value”:{“statusBar”:85}}
03-26 16:51:34.412 6442 6476 I appium : channel read: GET /wd/hub/session/5dc51c59-cc13-4679-9a27-41c8ba1f8eef/window/current/size
03-26 16:51:34.413 6442 6476 I appium : GetDeviceSize command
03-26 16:51:34.413 6442 6476 I appium : Get window size of the device
03-26 16:51:34.419 6442 6476 I appium : AppiumResponse: {“sessionId”:“5dc51c59-cc13-4679-9a27-41c8ba1f8eef”,“value”:{“height”:2159,“width”:1080}}
03-26 16:51:34.429 6442 6476 I appium : channel read: POST /wd/hub/session/5dc51c59-cc13-4679-9a27-41c8ba1f8eef/appium/settings
03-26 16:51:34.431 6442 6476 I appium : UpdateSettings command
03-26 16:51:34.442 6442 6476 I appium : AppiumResponse: {“sessionId”:“5dc51c59-cc13-4679-9a27-41c8ba1f8eef”,“value”:null}
03-26 16:51:34.479 6442 6476 I appium : channel read: POST /wd/hub/session/5dc51c59-cc13-4679-9a27-41c8ba1f8eef/element
03-26 16:51:34.481 6442 6476 I appium : FindElement command
03-26 16:51:34.486 6442 6476 I appium : method: ‘xpath’, selector: ‘//[@text=‘通讯录’]’, contextId: ‘’
03-26 16:51:34.488 6442 6476 I appium : Waiting up to 60ms for the device to idle
03-26 16:51:35.211 6442 6476 I appium : Took 20ms to retrieve 1 matches for '//
[@text=‘通讯录’]’ XPath query
03-26 16:51:35.228 6442 6476 I appium : AppiumResponse: {“sessionId”:“5dc51c59-cc13-4679-9a27-41c8ba1f8eef”,“value”:{“ELEMENT”:“d6ad7150-883b-492f-aeae-c6cf7237ca8c”,“element-6066-11e4-a52e-4f735466cecf”:“d6ad7150-883b-492f-aeae-c6cf7237ca8c”}}
03-26 16:51:35.276 6442 6476 I appium : channel read: POST /wd/hub/session/5dc51c59-cc13-4679-9a27-41c8ba1f8eef/element/d6ad7150-883b-492f-aeae-c6cf7237ca8c/click
03-26 16:51:35.277 6442 6476 I appium : Click command
03-26 16:51:35.883 6442 6476 I appium : Waiting up to 60ms for the device to idle
03-26 16:51:36.073 6442 6476 I appium : AppiumResponse: {“sessionId”:“5dc51c59-cc13-4679-9a27-41c8ba1f8eef”,“value”:null}
03-26 16:51:36.113 6442 6476 I appium : channel read: POST /wd/hub/session/5dc51c59-cc13-4679-9a27-41c8ba1f8eef/element
03-26 16:51:36.115 6442 6476 I appium : FindElement command
03-26 16:51:36.123 6442 6476 I appium : method: ‘xpath’, selector: ‘//[@text=‘添加成员’]’, contextId: ‘’
03-26 16:51:36.124 6442 6476 I appium : Waiting up to 60ms for the device to idle
03-26 16:51:36.641 6442 6476 I appium : Took 16ms to retrieve 1 matches for '//
[@text=‘添加成员’]’ XPath query
03-26 16:51:36.645 6442 6476 I appium : AppiumResponse: {“sessionId”:“5dc51c59-cc13-4679-9a27-41c8ba1f8eef”,“value”:{“ELEMENT”:“50acda19-e086-4127-aec0-1e8579d5618a”,“element-6066-11e4-a52e-4f735466cecf”:“50acda19-e086-4127-aec0-1e8579d5618a”}}
03-26 16:51:36.674 6442 6476 I appium : channel read: POST /wd/hub/session/5dc51c59-cc13-4679-9a27-41c8ba1f8eef/element/50acda19-e086-4127-aec0-1e8579d5618a/click
03-26 16:51:36.676 6442 6476 I appium : Click command
03-26 16:51:36.877 6442 6476 I appium : Waiting up to 60ms for the device to idle
03-26 16:51:36.880 6442 6476 I appium : AppiumResponse: {“sessionId”:“5dc51c59-cc13-4679-9a27-41c8ba1f8eef”,“value”:null}
03-26 16:51:38.414 6442 6476 I appium : channel read: POST /wd/hub/session/5dc51c59-cc13-4679-9a27-41c8ba1f8eef/element
03-26 16:51:38.417 6442 6476 I appium : FindElement command
03-26 16:51:38.425 6442 6476 I appium : method: ‘xpath’, selector: ‘//[@text=‘手动输入添加’]’, contextId: ‘’
03-26 16:51:38.426 6442 6476 I appium : Waiting up to 60ms for the device to idle
03-26 16:51:38.694 6442 6476 I appium : Took 12ms to retrieve 1 matches for '//
[@text=‘手动输入添加’]’ XPath query
03-26 16:51:38.697 6442 6476 I appium : AppiumResponse: {“sessionId”:“5dc51c59-cc13-4679-9a27-41c8ba1f8eef”,“value”:{“ELEMENT”:“c1503ac6-963c-4e47-8bbb-0c5463e3dff9”,“element-6066-11e4-a52e-4f735466cecf”:“c1503ac6-963c-4e47-8bbb-0c5463e3dff9”}}
03-26 16:51:38.714 6442 6476 I appium : channel read: POST /wd/hub/session/5dc51c59-cc13-4679-9a27-41c8ba1f8eef/element/c1503ac6-963c-4e47-8bbb-0c5463e3dff9/click
03-26 16:51:38.715 6442 6476 I appium : Click command

之前的都没问题,说明这次点击遇到了问题导致卡死了。点击或者点击完返回结果的时候出bug了。你是用的是什么手机?鸿蒙系统嘛?

你可以试试 settings里增加一个 waitForIdleTimeout 配置试试。

driver.setSetting(Setting.WAIT_FOR_IDLE_TIMEOUT, 0);

或者

self.driver.update_settings({"waitForIdleTimeout": 0}))

可能的原因

  • appium或者底层的uiautomator driver版本的bug问题
  • settings api估计需要设置
  • 特定的手机系统有bug
  • 试试延缓下点击的时机

用的手机=华为 P20 ,系统=EMUI
1、desire_caps里已进化设置了. “settings[waitForIdleTimeout]”: 0
2、设置了全局隐式等待 self.driver.implicitly_wait(30)
这个问题还是存在

*Appium 降级到v1.18.3
*AndroidUiautomator2Driver (v1.56.1)
*UIAutomator2 server 4.12.2

我之前在鸿蒙系统上遇到过一些类似的bug,我觉得你可以换下手机试试。本质是uiautomator server在底层的逻辑有bug,修改起来会比较麻烦,只能先想办法绕过了。

这几个方法可以都试试

  • 换到非鸿蒙系统的手机
  • 降级下appium
  • 使用uiautomator1的方案
关闭