请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

切换到H5页面后 无法定位

Microsoft Windows [版本 10.0.17763.1039]
© 2018 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>appium
[Appium] Welcome to Appium v1.16.0
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {“capabilities”:{“firstMatch”:[{“platformName”:“Android”,“appium:deviceName”:“127.0.0.1:21503”,“appium:platformVersion”:“5.1.1”,“appium:noReset”:true,“appium:app”:“C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk”}]},“desiredCapabilities”:{“platformName”:“Android”,“deviceName”:“127.0.0.1:21503”,“platformVersion”:“5.1.1”,“noReset”:true,“app”:“C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk”}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{“platformName”:“Android”,“deviceName”:“127.0.0.1:21503”,“platformVersion”:“5.1.1”,“noReset”:true,“app”:“C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk”},null,{“firstMatch”:[{“platformName”:“Android”,“appium:deviceName”:“127.0.0.1:21503”,“appium:platformVersion”:“5.1.1”,“appium:noReset”:true,“appium:app”:“C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk”}]}]
[debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1582614915062 (15:15:15 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] http://appium.io/docs/en/about-appium/intro/ and explore the
[Appium] ‘Drivers’ menu
[Appium]
[Appium] ======================================================================
[Appium]
[Appium] Appium v1.16.0 creating new AndroidUiautomator2Driver (v1.43.0) 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”: “127.0.0.1:21503”,
[debug] [BaseDriver] “appium:platformVersion”: “5.1.1”,
[debug] [BaseDriver] “appium:noReset”: true,
[debug] [BaseDriver] “appium:app”: “C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk”
[debug] [BaseDriver] },
[debug] [BaseDriver] “firstMatch”: [
[debug] [BaseDriver] {}
[debug] [BaseDriver] ]
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6
[BaseDriver] Using local app ‘C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk’
[debug] [UiAutomator2] Checking whether app is actually present
[ADB] Found 1 ‘build-tools’ folders under ‘D:\Andriod_SDK’ (newest first):
[ADB] D:/Andriod_SDK/build-tools/27.0.1
[ADB] Using ‘adb.exe’ from ‘D:\Andriod_SDK\platform-tools\adb.exe’
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices…
[debug] [ADB] Connected devices: [{“udid”:“127.0.0.1:21503”,“state”:“device”}]
[AndroidDriver] Looking for a device with Android ‘5.1.1’
[debug] [ADB] Setting device id to 127.0.0.1:21503
[ADB] Getting device platform version
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell getprop ro.build.version.release’
[debug] [ADB] Current device property ‘ro.build.version.release’: 5.1.1
[AndroidDriver] Using device: 127.0.0.1:21503
[ADB] Using ‘adb.exe’ from ‘D:\Andriod_SDK\platform-tools\adb.exe’
[debug] [ADB] Setting device id to 127.0.0.1:21503
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell getprop ro.build.version.sdk’
[debug] [ADB] Current device property ‘ro.build.version.sdk’: 22
[debug] [ADB] Device API level: 22
[debug] [AndroidDriver] Parsing package and activity from app manifest
[ADB] Package name: ‘com.wljm.wulianjiayuan’
[ADB] Main activity name: ‘cn.wildfire.chat.app.launcher_module.activity.AppSplashActivity’
[debug] [AndroidDriver] Parsed package and activity are: com.wljm.wulianjiayuan/cn.wildfire.chat.app.launcher_module.activity.AppSplashActivity
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 wait-for-device’
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell echo ping’
[debug] [AndroidDriver] Pushing settings apk to device…
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell dumpsys package io.appium.settings’
[debug] [ADB] ‘io.appium.settings’ is installed
[debug] [ADB] Getting package info for ‘io.appium.settings’
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell dumpsys package io.appium.settings’
[debug] [ADB] The version name of the installed ‘io.appium.settings’ is greater or equal to the application version name (‘3.1.0’ >= ‘3.1.0’)
[debug] [ADB] There is no need to install/upgrade ‘C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_io.appium.settings@3.1.0@io.appium.settings\apks\settings_apk-debug.apk’
[debug] [ADB] Getting IDs of all ‘io.appium.settings’ processes
[debug] [ADB] Using ps-based PID detection
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell ps’
[debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell settings put secure mock_location 1’
[debug] [Logcat] Starting logcat capture
[debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8203
[debug] [ADB] Forwarding system: 8203 to device: 6790
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 forward tcp:8203 tcp:6790’
[debug] [ADB] Getting install status for io.appium.uiautomator2.server
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 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 ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 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.5.5’ >= ‘4.5.5’)
[debug] [UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled
[debug] [ADB] Checking app cert for C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_appium-uiautomator2-server@4.5.5@appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.5.5.apk
[ADB] Using ‘apksigner.bat’ from ‘D:\Andriod_SDK\build-tools\27.0.1\apksigner.bat’
[debug] [ADB] Starting ‘D:\Andriod_SDK\build-tools\27.0.1\apksigner.bat’ with args ‘[“verify”,"–print-certs",“C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules\_appium-uiautomator2-server@4.5.5@appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.5.5.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] ‘C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_appium-uiautomator2-server@4.5.5@appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.5.5.apk’ is already signed.
[debug] [ADB] Getting install status for io.appium.uiautomator2.server.test
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell dumpsys package io.appium.uiautomator2.server.test’
[debug] [ADB] ‘io.appium.uiautomator2.server.test’ is installed
[debug] [ADB] Checking app cert for C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_appium-uiautomator2-server@4.5.5@appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk
[debug] [ADB] Starting ‘D:\Andriod_SDK\build-tools\27.0.1\apksigner.bat’ with args ‘[“verify”,"–print-certs",“C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules\_appium-uiautomator2-server@4.5.5@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] ‘C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_appium-uiautomator2-server@4.5.5@appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk’ is already signed.
[UiAutomator2] Server packages are not going to be (re)installed
[debug] [UiAutomator2] Waiting up to 30000ms for services to be available
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell pm list instrumentation’
[debug] [UiAutomator2] Instrumentation target ‘io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner’ is available
[debug] [ADB] Checking app cert for C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk
[debug] [ADB] Starting ‘D:\Andriod_SDK\build-tools\27.0.1\apksigner.bat’ with args ‘[“verify”,"–print-certs",“C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.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] ‘C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk’ is already signed.
[debug] [ADB] Getting install status for com.wljm.wulianjiayuan
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell dumpsys package com.wljm.wulianjiayuan’
[debug] [ADB] ‘com.wljm.wulianjiayuan’ is installed
[debug] [ADB] Getting package info for ‘com.wljm.wulianjiayuan’
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell dumpsys package com.wljm.wulianjiayuan’
[debug] [ADB] The version name of the installed ‘com.wljm.wulianjiayuan’ is greater or equal to the application version name (‘1.0.1’ >= ‘1.0.1’)
[debug] [ADB] There is no need to install/upgrade ‘C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk’
[debug] [UiAutomator2] Performing shallow cleanup of automation leftovers
[debug] [UiAutomator2] The following obsolete sessions are still running: [“966f9e1a-827e-4393-adae-365a007260f6”]
[debug] [UiAutomator2] Cleaning up the obsolete sessions
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell am force-stop io.appium.uiautomator2.server.test’
[UiAutomator2] Starting UIAutomator2 server 4.5.5
[UiAutomator2] Using UIAutomator2 server from ‘C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_appium-uiautomator2-server@4.5.5@appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.5.5.apk’ and test from ‘C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_appium-uiautomator2-server@4.5.5@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",“127.0.0.1:21503”,“shell”,“am”,“instrument”,"-w",“io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner”]
[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:8203/wd/hub/status] with no body
[WD Proxy] Got an unexpected response with status undefined: {“code”:“ECONNRESET”}
[debug] [WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8203/wd/hub/status] with no body
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“None”,“value”:{“ready”:true,“message”:“UiAutomator2 Server is ready to accept commands”}}
[debug] [UiAutomator2] The initialization of the instrumentation process took 2041ms
[debug] [WD Proxy] Matched ‘/session’ to command name ‘createSession’
[debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8203/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”:“127.0.0.1:21503”,“platformVersion”:“5.1.1”,“noReset”:true,“app”:“C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk”},“platformName”:“Android”,“deviceName”:“127.0.0.1:21503”,“platformVersion”:“5.1.1”,“noReset”:true,“app”:“C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk”,“deviceUDID”:“127.0.0.1:21503”,“appPackage”:“com.wljm.wulianjiayuan”}],“alwaysMatch”:{}}}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“28fc6512-d204-4768-a13a-79340873f669”,“value”:{“sessionId”:“28fc6512-d204-4768-a13a-79340873f669”,“capabilities”:{“firstMatch”:[{“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platformName”:“Android”,“deviceName”:“127.0.0.1:21503”,“platformVersion”:“5.1.1”,“noReset”:true,“app”:“C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk”},“platformName”:“Android”,“deviceName”:“127.0.0.1:21503”,“platformVersion”:“5.1.1”,“noReset”:true,“app”:“C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk”,“deviceUDID”:“127.0.0.1:21503”,“appPackage”:“com.wljm.wulianjiayuan”}],“alwaysMatch”:{}}}}
[WD Proxy] Determined the downstream protocol as ‘W3C’
[debug] [WD Proxy] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8203/wd/hub/session/28fc6512-d204-4768-a13a-79340873f669/appium/device/info] with no body
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“28fc6512-d204-4768-a13a-79340873f669”,“value”:{“androidId”:“02ed5a44c77dea04”,“manufacturer”:“HUAWEI”,“model”:“DUK-AL20”,“brand”:“HUAWEI”,“apiVersion”:“22”,“platformVersion”:“5.1.1”,“carrierName”:“China Mobile GSM”,“realDisplaySize”:“720x1280”,“displayDensity”:192,“networks”:[{“type”:1,“typeName”:“WIFI”,“subtype”:0,“subtypeName”:"",“isConnected”:true,“detailedState”:“CONNECTED”,“state”:“CONNECTED”,“extraInfo”:"“mwxlydt743"”,“isAvailable”:true,“isFailover”:false,“isRoaming”:false,“capabilities”:{“transportTypes”:“TRANSPORT_WIFI”,“networkCapabilities”:“NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_INTERNET,NET_CAPABILITY_TRUSTED”,“linkUpstreamBandwidthKbps”:1048576,“linkDownBandwidthKbps”:1048576,“signalStrength”:null,“networkSpecifier”:null,“SSID”:null}}],“locale”:“zh_CN”,“timeZone”:“Asia/Shanghai”,“bluetooth”:{“state”:“OFF”}}}
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell dumpsys window’
[AndroidDriver] Screen already unlocked, doing nothing
[UiAutomator2] Starting 'com.wljm.wulianjiayuan/cn.wildfire.chat.app.launcher_module.activity.AppSplashActivity and waiting for ‘com.wljm.wulianjiayuan/cn.wildfire.chat.app.launcher_module.activity.AppSplashActivity’
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell am start -W -n com.wljm.wulianjiayuan/cn.wildfire.chat.app.launcher_module.activity.AppSplashActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’
[debug] [ADB] Waiting up to 20000ms for activity matching pkg: ‘com.wljm.wulianjiayuan’ and activity: ‘cn.wildfire.chat.app.launcher_module.activity.AppSplashActivity’ to be focused
[debug] [ADB] Possible activities, to be checked: ‘cn.wildfire.chat.app.launcher_module.activity.AppSplashActivity’, ‘com.wljm.wulianjiayuan.cn.wildfire.chat.app.launcher_module.activity.AppSplashActivity’
[debug] [ADB] Getting focused package and activity
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell dumpsys window windows’
[debug] [ADB] Found package: ‘com.wljm.wulianjiayuan’ and fully qualified activity name : ‘cn.wildfire.chat.app.launcher_module.activity.AppSplashActivity’
[debug] [WD Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8203/wd/hub/session/28fc6512-d204-4768-a13a-79340873f669/appium/device/pixel_ratio] with body: {}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“28fc6512-d204-4768-a13a-79340873f669”,“value”:1.2}
[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:8203/wd/hub/session/28fc6512-d204-4768-a13a-79340873f669/appium/device/system_bars] with body: {}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“28fc6512-d204-4768-a13a-79340873f669”,“value”:{“statusBar”:30}}
[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:8203/wd/hub/session/28fc6512-d204-4768-a13a-79340873f669/window/current/size] with body: {}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“28fc6512-d204-4768-a13a-79340873f669”,“value”:{“height”:1280,“width”:720}}
[Appium] New AndroidUiautomator2Driver session created successfully, session dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6 added to master session list
[debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1582614924615 (15:15:24 GMT+0800 (GMT+08:00))
[debug] [W3C (dec3f8dc)] Cached the protocol value ‘W3C’ for the new session dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6
[debug] [W3C (dec3f8dc)] 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”:“127.0.0.1:21503”,“platformVersion”:“5.1.1”,“noReset”:true,“app”:“C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk”},“platformName”:“Android”,“deviceName”:“127.0.0.1:21503”,“platformVersion”:“5.1.1”,“noReset”:true,“app”:“C:\Users\Administrator\Desktop\Appium-Andorid-Python\apps\com.wljm.wulianjiayuan.apk”,“deviceUDID”:“127.0.0.1:21503”,“appPackage”:“com.wljm.wulianjiayuan”,“deviceApiLevel”:22,“deviceScreenSize”:“720x1280”,“deviceScreenDensity”:192,“deviceModel”:“DUK-AL20”,“deviceManufacturer”:“HUAWEI”,“pixelRatio”:1.2,“statBarHeight”:30,“viewportRect”:{“left”:0,“top”:30,“width”:720,“height”:1250}}}
[HTTP] <-- POST /wd/hub/session 200 9560 ms - 974
[HTTP]
[HTTP] --> GET /wd/hub/session/dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6/contexts
[HTTP] {}
[debug] [W3C (dec3f8dc)] Calling AppiumDriver.getContexts() with args: [“dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6”]
[debug] [AndroidDriver] Getting a list of available webviews
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell cat /proc/net/unix’
[AndroidDriver] Not checking whether webviews have active pages; use the ‘ensureWebviewsHavePages’ cap to turn this check on
[debug] [AndroidDriver] WEBVIEW_8926 mapped to pid 8926
[debug] [AndroidDriver] Getting process name for webview
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell ps’
[debug] [AndroidDriver] Parsed pid: ‘8926’ pkg: ‘com.wljm.wulianjiayuan’ from
[debug] [AndroidDriver] USER PID PPID VSIZE RSS WCHAN PC NAME
[debug] [AndroidDriver] u0_a31 8926 97 1236004 159500 ffffffff b74b0585 S com.wljm.wulianjiayuan
[debug] [AndroidDriver] Returning process name: ‘com.wljm.wulianjiayuan’
[debug] [AndroidDriver] Found webviews: [“WEBVIEW_stetho_com.wljm.wulianjiayuan”,“WEBVIEW_stetho_com.wljm.wulianjiayuan:pushservice”,“WEBVIEW_stetho_com.wljm.wulianjiayuan:marsservice”,“WEBVIEW_com.wljm.wulianjiayuan”]
[debug] [AndroidDriver] Available contexts: [“NATIVE_APP”,“WEBVIEW_stetho_com.wljm.wulianjiayuan”,“WEBVIEW_stetho_com.wljm.wulianjiayuan:pushservice”,“WEBVIEW_stetho_com.wljm.wulianjiayuan:marsservice”,“WEBVIEW_com.wljm.wulianjiayuan”]
[debug] [W3C (dec3f8dc)] Responding to client with driver.getContexts() result: [“NATIVE_APP”,“WEBVIEW_stetho_com.wljm.wulianjiayuan”,“WEBVIEW_stetho_com.wljm.wulianjiayuan:pushservice”,“WEBVIEW_stetho_com.wljm.wulianjiayuan:marsservice”,“WEBVIEW_com.wljm.wulianjiayuan”]
[HTTP] <-- GET /wd/hub/session/dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6/contexts 200 165 ms - 201
[HTTP]
[HTTP] --> POST /wd/hub/session/dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6/context
[HTTP] {“name”:“WEBVIEW_com.wljm.wulianjiayuan”}
[debug] [W3C (dec3f8dc)] Calling AppiumDriver.setContext() with args: [“WEBVIEW_com.wljm.wulianjiayuan”,“dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6”]
[debug] [AndroidDriver] Getting a list of available webviews
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell cat /proc/net/unix’
[AndroidDriver] Not checking whether webviews have active pages; use the ‘ensureWebviewsHavePages’ cap to turn this check on
[debug] [AndroidDriver] WEBVIEW_8926 mapped to pid 8926
[debug] [AndroidDriver] Getting process name for webview
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell ps’
[debug] [AndroidDriver] Parsed pid: ‘8926’ pkg: ‘com.wljm.wulianjiayuan’ from
[debug] [AndroidDriver] USER PID PPID VSIZE RSS WCHAN PC NAME
[debug] [AndroidDriver] u0_a31 8926 97 1236004 159500 ffffffff b74b0585 S com.wljm.wulianjiayuan
[debug] [AndroidDriver] Returning process name: ‘com.wljm.wulianjiayuan’
[debug] [AndroidDriver] Found webviews: [“WEBVIEW_stetho_com.wljm.wulianjiayuan”,“WEBVIEW_stetho_com.wljm.wulianjiayuan:pushservice”,“WEBVIEW_stetho_com.wljm.wulianjiayuan:marsservice”,“WEBVIEW_com.wljm.wulianjiayuan”]
[debug] [AndroidDriver] Available contexts: [“NATIVE_APP”,“WEBVIEW_stetho_com.wljm.wulianjiayuan”,“WEBVIEW_stetho_com.wljm.wulianjiayuan:pushservice”,“WEBVIEW_stetho_com.wljm.wulianjiayuan:marsservice”,“WEBVIEW_com.wljm.wulianjiayuan”]
[debug] [AndroidDriver] Connecting to chrome-backed webview context ‘WEBVIEW_com.wljm.wulianjiayuan’
[debug] [AndroidDriver] A port was not given, using random free port: 8000
[debug] [AndroidDriver] Automated Chromedriver download is disabled. Use ‘chromedriver_autodownload’ server feature to enable it
[debug] [AndroidDriver] Before starting chromedriver, androidPackage is ‘com.wljm.wulianjiayuan’
[debug] [Chromedriver] Changed state to ‘starting’
[debug] [Chromedriver] Found 1 executable in ‘C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_appium-chromedriver@4.20.2@appium-chromedriver\chromedriver\win’
[debug] [Chromedriver] The following Chromedriver executables were found:
[debug] [Chromedriver] ‘C:/Users/Administrator/AppData/Roaming/npm/node_modules/appium/node_modules/_appium-chromedriver@4.20.2@appium-chromedriver/chromedriver/win/chromedriver.exe’ (version ‘2.24’, minimum Chrome version ‘52.0.2743’)
[debug] [ADB] Getting package info for ‘com.google.android.webview’
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell dumpsys package com.google.android.webview’
[debug] [ADB] Getting package info for ‘com.android.webview’
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 shell dumpsys package com.android.webview’
[debug] [Chromedriver] Found Chrome bundle ‘com.android.webview’ version ‘52.0.2743’
[debug] [Chromedriver] Found 1 Chromedriver executable capable of automating Chrome ‘52.0.2743’.
[debug] [Chromedriver] Choosing the most recent, ‘C:/Users/Administrator/AppData/Roaming/npm/node_modules/appium/node_modules/_appium-chromedriver@4.20.2@appium-chromedriver/chromedriver/win/chromedriver.exe’.
[debug] [Chromedriver] If a specific version is required, specify it with the chromedriverExecutabledesired capability.
[Chromedriver] Set chromedriver binary as: C:/Users/Administrator/AppData/Roaming/npm/node_modules/appium/node_modules/_appium-chromedriver@4.20.2@appium-chromedriver/chromedriver/win/chromedriver.exe
[debug] [Chromedriver] Killing any old chromedrivers, running: wmic process where “commandline like ‘%chromedriver.exe%–port=8000%’” delete
[debug] [Chromedriver] Successfully cleaned up old chromedrivers
[debug] [Chromedriver] Cleaning any old adb forwarded port socket connections
[debug] [ADB] List forwarding ports
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 forward --list’
[debug] [ADB] Removing forwarded port socket connection: 12623
[debug] [ADB] Running ‘D:\Andriod_SDK\platform-tools\adb.exe -P 5037 -s 127.0.0.1:21503 forward --remove tcp:12623’
[Chromedriver] Spawning chromedriver with: C:/Users/Administrator/AppData/Roaming/npm/node_modules/appium/node_modules/_appium-chromedriver@4.20.2@appium-chromedriver/chromedriver/win/chromedriver.exe --url-base=wd/hub --port=8000 --adb-port=5037 --verbose
[debug] [Chromedriver] Chromedriver version: ‘2.24.417431’
[debug] [Chromedriver] Chromedriver v. 2.24.417431 does not fully support W3C protocol. Defaulting to MJSONWP
[debug] [WD Proxy] Matched ‘/status’ to command name ‘getStatus’
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body
[debug] [WD Proxy] Got response with status 200: {“sessionId”:"",“status”:0,“value”:{“build”:{“version”:“alpha”},“os”:{“arch”:“x86_64”,“name”:“Windows NT”,“version”:“10.0.17763”}}}
[Chromedriver] Starting MJSONWP Chromedriver session with capabilities: {
[Chromedriver] “desiredCapabilities”: {
[Chromedriver] “chromeOptions”: {
[Chromedriver] “androidPackage”: “com.wljm.wulianjiayuan”,
[Chromedriver] “androidUseRunningApp”: true,
[Chromedriver] “androidDeviceSerial”: “127.0.0.1:21503”
[Chromedriver] },
[Chromedriver] “loggingPrefs”: {
[Chromedriver] “browser”: “ALL”
[Chromedriver] }
[Chromedriver] }
[Chromedriver] }
[debug] [WD Proxy] Matched ‘/session’ to command name ‘createSession’
[debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“androidPackage”:“com.wljm.wulianjiayuan”,“androidUseRunningApp”:true,“androidDeviceSerial”:“127.0.0.1:21503”},“loggingPrefs”:{“browser”:“ALL”}}}
[debug] [Chromedriver] Webview version: ‘Chrome/52.0.2743.100’
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“f2e45f861603c00f4073769020a8d2c3”,“status”:0,“value”:{“acceptSslCerts”:true,“applicationCacheEnabled”:false,“browserConnectionEnabled”:false,“browserName”:“chrome”,“chrome”:{“chromedriverVersion”:“2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf)”},“cssSelectorsEnabled”:true,“databaseEnabled”:false,“handlesAlerts”:true,“hasTouchScreen”:true,“javascriptEnabled”:true,“locationContextEnabled”:true,“mobileEmulationEnabled”:false,“nativeEvents”:true,“pageLoadStrategy”:“normal”,“platform”:“ANDROID”,“rotatable”:false,“takesHeapSnapshot”:true,“takesScreenshot”:true,“version”:“52.0.2743.100”,“webStorageEnabled”:true}}
[WD Proxy] Determined the downstream protocol as ‘MJSONWP’
[debug] [Chromedriver] Changed state to ‘online’
[debug] [W3C (dec3f8dc)] Responding to client with driver.setContext() result: null
[HTTP] <-- POST /wd/hub/session/dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6/context 200 2813 ms - 14
[HTTP]
[HTTP] --> POST /wd/hub/session/dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6/element
[HTTP] {“using”:“xpath”,“value”:"//[@id=“appIndex”]/div[2]/div[4]/span"}
[W3C (dec3f8dc)] Driver proxy active, passing request on via HTTP proxy
[debug] [WD Proxy] Matched ‘/wd/hub/session/dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /wd/hub/session/dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6/element] to [POST http://127.0.0.1:8000/wd/hub/session/f2e45f861603c00f4073769020a8d2c3/element] with body: {“using”:“xpath”,“value”:"//
[@id=“appIndex”]/div[2]/div[4]/span"}
[debug] [WD Proxy] Got response with status 200: {“sessionId”:“f2e45f861603c00f4073769020a8d2c3”,“status”:7,“value”:{“message”:“no such element: Unable to locate element: {“method”:“xpath”,“selector”:”//*[@id=“appIndex”]/div[2]/div[4]/span"}\n (Session info: chrome=52.0.2743.100)\n (Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf),platform=Windows NT 10.0.17763 x86_64)"}}
[WD Proxy] The response has an unknown format
[debug] [W3C (dec3f8dc)] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: The request to /wd/hub/session/dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6/element has failed
[debug] [W3C (dec3f8dc)] at JWProxy.proxy (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_appium-base-driver@5.3.0@appium-base-driver\lib\jsonwp-proxy\proxy.js:222:13)
[debug] [W3C (dec3f8dc)] at ProtocolConverter.convertAndProxy (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_appium-base-driver@5.3.0@appium-base-driver\lib\jsonwp-proxy\protocol-converter.js:245:12)
[debug] [W3C (dec3f8dc)] at JWProxy.proxyCommand (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_appium-base-driver@5.3.0@appium-base-driver\lib\jsonwp-proxy\proxy.js:258:12)
[debug] [W3C (dec3f8dc)] at JWProxy.proxyReqRes (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_appium-base-driver@5.3.0@appium-base-driver\lib\jsonwp-proxy\proxy.js:308:36)
[debug] [W3C (dec3f8dc)] at Chromedriver.proxyReq (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules_appium-chromedriver@4.20.2@appium-chromedriver\lib\chromedriver.js:674:12)
[debug] [MJSONWP] Matched JSONWP error code 7 to NoSuchElementError
[HTTP] <-- POST /wd/hub/session/dec3f8dc-18d8-4d8c-aeb0-7a361904ddb6/element 404 174 ms - 1254
[HTTP]

正在回答 回答被采纳积分+3

3回答

Mushishi 2020-02-29 19:11:30

还有,你chromedriver 是2.24版本,对应得chrome 你去看一下是不是Chrome v52-54在这个范围之内

0 回复 有任何疑惑可以回复我~
Mushishi 2020-02-29 19:08:56

https://img1.sycdn.imooc.com/szimg/5e5a458609dfaa3b09450440.jpg

1、你这里是报错没办法找到元素

2、元素没找到你这个嵌套得是H5,所以你需要确定1、你是否切入了H5页面,你可通过获取页面源代码去看一下是否切入进入了driver.page_source

3、如果正常切入,你就找一个最最最最简单得元素,通过id看是否能够定位。如果能定位说明你得xpath有问题

0 回复 有任何疑惑可以回复我~
提问者 慕粉0312223738 2020-02-25 15:16:58

#coding:utf-8
from appium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
import time,os
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By

desired_caps = {'platformName': 'Android',
               'deviceName': '127.0.0.1:21503',
               'platformVersion': '5.1.1',
               'noReset': True,
               'app':'C:\\Users\\Administrator\\Desktop\\Appium-Andorid-Python\\apps\\com.wljm.wulianjiayuan.apk',
}

driver=webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
time.sleep(10)

contexts = driver.contexts
print(contexts)
driver.switch_to.context('WEBVIEW_com.wljm.wulianjiayuan')
# 家祠
print('点击家祠')
time.sleep(10)
driver.find_element_by_xpath('//*[@id="appIndex"]/div[2]/div[4]/span').click()

0 回复 有任何疑惑可以回复我~
  • 提问者 慕粉0312223738 #1
    有些定位到有些定位不到不知道什么情况 请老师帮忙看看谢谢
    回复 有任何疑惑可以回复我~ 2020-02-25 15:18:20
  • Mushishi 回复 提问者 慕粉0312223738 #2
    [debug] [MJSONWP] Matched JSONWP error code 7 to NoSuchElementError 元素 你看一下你xpath是不是对得。
    回复 有任何疑惑可以回复我~ 2020-02-26 21:19:27
  • 提问者 慕粉0312223738 回复 Mushishi #3
    我用pc端 chrome 浏览器自带 右键复制唯一xpath路径,也用class name定位也不行。我用的是逍遥模拟器,但没有装chrome浏览器,然后运行切换H5提示chromedriver 版本过高,换了低版chromedriver才可以跑。会不会和这些有关系?
    回复 有任何疑惑可以回复我~ 2020-02-26 21:48:53
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信