我本地已经安装好了opencv4nodejs,运行appium-doctor时反馈如下:
但是执行测试脚本,appium-server日志报找不到opencv4nodejs,报错如下:
有高手遇到过这个问题么?该问题困扰两天了
我的环境:
mac M1,Big Sur 11.3
Homebrew 3.3.15
node v17.5.0
npm 8.5.0
opencv 4.5.4.4
我本地已经安装好了opencv4nodejs,运行appium-doctor时反馈如下:
但是执行测试脚本,appium-server日志报找不到opencv4nodejs,报错如下:
有高手遇到过这个问题么?该问题困扰两天了
我的环境:
mac M1,Big Sur 11.3
Homebrew 3.3.15
node v17.5.0
npm 8.5.0
opencv 4.5.4.4
重新安装了,还是这样
你把测试脚本和完整log贴上来
-----------------------------------------下面这段是测试代码--------------------------
/**
* 测试appium-opencv图像识别测试
*/
@Test
public void testOpenCV() throws InterruptedException, IOException {
// 点击我的
LOGGER.info("开始执行测试");
driver.findElementByAndroidUIAutomator("new UiSelector().resourceId(\"com.ganji.android:id/navigation_mine_img\")").click();
LOGGER.info("点击【我的】成功");
driver.findElementByAndroidUIAutomator("new UiSelector().resourceId(\"com.ganji.android:id/img_user_info_page\")").click();
Thread.sleep(4000);
int width = driver.manage().window().getSize().getWidth();
int height = driver.manage().window().getSize().getHeight();
TouchAction touchAction = new TouchAction(driver);
touchAction.press(PointOption.point((int)(width*0.5), (int)(height*0.18)))
.waitAction(WaitOptions.waitOptions(Duration.ofMillis(7000)))
.moveTo(PointOption.point((int)(width*0.5), (int)(height*0.95)))
.release().perform();
MobileElement myPointView = driver.findElement(MobileBy.image(getImageAsBase64String("myPointView")));
myPointView.click();
Thread.sleep(5000);
}
private String getImageAsBase64String (String imageName) throws IOException {
File file = new File(System.getProperty("user.dir") + "/matchImages/" + imageName + ".png");
return Base64.getEncoder().encodeToString(Files.readAllBytes(file.toPath()));
}
---------------------------------下面这段是appium.log日志-----------------------
debug] [W3C] Calling AppiumDriver.createSession() with args: [{"appActivity":"com.wuba.activity.launch.LaunchActivity","appPackage":"com.ganji.android","noReset":true,"nativeWebScreenshot":true,"ensureWebviewsHavePages":true,"platformName":"Android","udid":"7XBRX18C21004820"},null,{"firstMatch":[{"appium:appActivity":"com.wuba.activity.launch.LaunchActivity","appium:appPackage":"com.ganji.android","appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:noReset":true,"platformName":"android","appium:udid":"7XBRX18C21004820"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1644911833096 (15:57:13 GMT+0800 (中国标准时间))
[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.22.0 creating new AndroidUiautomator2Driver (v1.69.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:appActivity": "com.wuba.activity.launch.LaunchActivity",
[debug] [BaseDriver] "appium:appPackage": "com.ganji.android",
[debug] [BaseDriver] "appium:ensureWebviewsHavePages": true,
[debug] [BaseDriver] "appium:nativeWebScreenshot": true,
[debug] [BaseDriver] "appium:noReset": true,
[debug] [BaseDriver] "appium:udid": "7XBRX18C21004820"
[debug] [BaseDriver] },
[debug] [BaseDriver] "firstMatch": [
[debug] [BaseDriver] {}
[debug] [BaseDriver] ]
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: 4af5160b-9962-417c-8735-171ff20349d1
[UiAutomator2] Starting 'com.ganji.android' directly on the device
[ADB] Using 'adb' from '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb'
[debug] [ADB] Running '/Users/zhengxiangyu/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":"7XBRX18C21004820","state":"device"}]
[AndroidDriver] Using device: 7XBRX18C21004820
[ADB] Using 'adb' from '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb'
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 start-server'
[debug] [ADB] Setting device id to 7XBRX18C21004820
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 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/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 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/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 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
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 wait-for-device'
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 shell echo ping'
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 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 '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 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.4.0' >= '3.4.0')
[debug] [ADB] There is no need to install/upgrade '/opt/homebrew/lib/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk'
[debug] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 shell 'pgrep --help; echo $?''
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 shell pgrep -f \(\[\[:blank:\]\]\|\^\)io\.appium\.settings\(\[\[:blank:\]\]\|\$\)'
[debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 shell appops set io.appium.settings android:mock_location allow'
[debug] [Logcat] Starting logs capture with command: /Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 logcat -v threadtime
[debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to local port 8200
[debug] [ADB] Forwarding system: 8200 to device: 6790
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 forward tcp:8200 tcp:6790'
[debug] [ADB] Getting install status for io.appium.uiautomator2.server
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 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/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 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.24.0' >= '4.24.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.24.0.apk
[debug] [ADB] Using the previously cached signature entry for 'appium-uiautomator2-server-v4.24.0.apk'
[debug] [ADB] sha256 hash did match for 'appium-uiautomator2-server-v4.24.0.apk'
[debug] [ADB] Getting install status for io.appium.uiautomator2.server.test
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 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] Using the previously cached signature entry for 'appium-uiautomator2-server-debug-androidTest.apk'
[debug] [ADB] sha256 hash did match for 'appium-uiautomator2-server-debug-androidTest.apk'
[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/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 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/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 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 (socket hang up)
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 shell am force-stop io.appium.uiautomator2.server.test'
[UiAutomator2] Starting UIAutomator2 server 4.24.0
[UiAutomator2] Using UIAutomator2 server from '/opt/homebrew/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.24.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","7XBRX18C21004820","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:8200/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:8200/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:8200/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:8200/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 3166ms
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8200/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","appActivity":"com.wuba.activity.launch.LaunchActivity","appPackage":"com.ganji.android","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"noReset":true,"udid":"7XBRX18C21004820"},"platformName":"android","appActivity":"com.wuba.activity.launch.LaunchActivity","appPackage":"com.ganji.android","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"noReset":true,"udid":"7XBRX18C21004820","deviceName":"7XBRX18C21004820","deviceUDID":"7XBRX18C21004820"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","appActivity":"com.wuba.activity.launch.LaunchActivity","appPackage":"com.ganji.android","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"noReset":true,"udid":"7XBRX18C21004820"},"platformName":"android","appActivity":"com.wuba.activity.launch.LaunchActivity","appPackage":"com.ganji.android","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"noReset":true,"udid":"7XBRX18C21004820","deviceName":"7XBRX18C21004820","deviceUDID":"7XBRX18C21004820"}],"alwaysMatch":{}},"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c"}}
[WD Proxy] Determined the downstream protocol as 'W3C'
[debug] [WD Proxy] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/appium/device/info] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"androidId":"5ba4bf52626f6f09","apiVersion":"29","bluetooth":{"state":"OFF"},"brand":"HONOR","carrierName":"中国电信","displayDensity":480,"locale":"zh_CN_#Hans","manufacturer":"HUAWEI","model":"JSN-AL00a","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":-49,"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/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 shell dumpsys window'
[AndroidDriver] Screen already unlocked, doing nothing
[UiAutomator2] Starting 'com.ganji.android/com.wuba.activity.launch.LaunchActivity and waiting for 'com.ganji.android/com.wuba.activity.launch.LaunchActivity'
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 shell am start -W -n com.ganji.android/com.wuba.activity.launch.LaunchActivity -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:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/appium/device/pixel_ratio] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","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:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/appium/device/system_bars] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"statusBar":85}}
[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:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/window/current/size] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"height":2255,"width":1080}}
[Appium] New AndroidUiautomator2Driver session created successfully, session 4af5160b-9962-417c-8735-171ff20349d1 added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1644911840268 (15:57:20 GMT+0800 (中国标准时间))
[debug] [W3C (4af5160b)] Cached the protocol value 'W3C' for the new session 4af5160b-9962-417c-8735-171ff20349d1
[debug] [W3C (4af5160b)] 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","appActivity":"com.wuba.activity.launch.LaunchActivity","appPackage":"com.ganji.android","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"noReset":true,"udid":"7XBRX18C21004820"},"platformName":"android","appActivity":"com.wuba.activity.launch.LaunchActivity","appPackage":"com.ganji.android","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"noReset":true,"udid":"7XBRX18C21004820","deviceName":"7XBRX18C21004820","deviceUDID":"7XBRX18C21004820","deviceApiLevel":29,"platformVersion":"10","deviceScreenSize":"1080x2340","deviceScreenDensity":480,"deviceModel":"JSN-AL00a","deviceManufacturer":"HUAWEI","pixelRatio":3,"statBarHeight":85,"viewportRect":{"left":0,"top":85,"width":1080,"height":2170}}}
[HTTP] <-- POST /wd/hub/session 200 7179 ms - 1027
[HTTP]
[HTTP] --> POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/timeouts
[HTTP] {"implicit":20000}
[debug] [W3C (4af5160b)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,20000,"4af5160b-9962-417c-8735-171ff20349d1"]
[debug] [BaseDriver] W3C timeout argument: {"implicit":20000}}
[debug] [BaseDriver] Set implicit wait to 20000ms
[debug] [W3C (4af5160b)] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/timeouts 200 1 ms - 14
[HTTP]
[HTTP] --> POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/element
[HTTP] {"using":"-android uiautomator","value":"new UiSelector().resourceId(\"com.ganji.android:id/navigation_mine_img\")"}
[debug] [W3C (4af5160b)] Calling AppiumDriver.findElement() with args: ["-android uiautomator","new UiSelector().resourceId(\"com.ganji.android:id/navigation_mine_img\")","4af5160b-9962-417c-8735-171ff20349d1"]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, css selector, -android uiautomator
[debug] [BaseDriver] Waiting up to 20000 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:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/element] with body: {"strategy":"-android uiautomator","selector":"new UiSelector().resourceId(\"com.ganji.android:id/navigation_mine_img\")","context":"","multiple":false}
[WD Proxy] Got response with status 404: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"error":"no such element","message":"An element could not be located on the page using the given search parameters","stacktrace":"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given search parameters\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:70)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:264)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:258)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.chann...
[debug] [W3C] Matched W3C error code 'no such element' to NoSuchElementError
[debug] [BaseDriver] Waited for 840 ms so far
[debug] [WD Proxy] Matched '/element' to command name 'findElement'
[debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/element] with body: {"strategy":"-android uiautomator","selector":"new UiSelector().resourceId(\"com.ganji.android:id/navigation_mine_img\")","context":"","multiple":false}
[WD Proxy] Got response with status 404: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"error":"no such element","message":"An element could not be located on the page using the given search parameters","stacktrace":"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given search parameters\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:70)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:264)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:258)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.chann...
[debug] [W3C] Matched W3C error code 'no such element' to NoSuchElementError
[debug] [BaseDriver] Waited for 1648 ms so far
[debug] [WD Proxy] Matched '/element' to command name 'findElement'
[debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/element] with body: {"strategy":"-android uiautomator","selector":"new UiSelector().resourceId(\"com.ganji.android:id/navigation_mine_img\")","context":"","multiple":false}
[WD Proxy] Got response with status 404: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"error":"no such element","message":"An element could not be located on the page using the given search parameters","stacktrace":"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given search parameters\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:70)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:264)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:258)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.chann...
[debug] [W3C] Matched W3C error code 'no such element' to NoSuchElementError
[debug] [BaseDriver] Waited for 2651 ms so far
[debug] [WD Proxy] Matched '/element' to command name 'findElement'
[debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/element] with body: {"strategy":"-android uiautomator","selector":"new UiSelector().resourceId(\"com.ganji.android:id/navigation_mine_img\")","context":"","multiple":false}
[WD Proxy] Got response with status 404: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"error":"no such element","message":"An element could not be located on the page using the given search parameters","stacktrace":"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given search parameters\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:70)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:264)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:258)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.chann...
[debug] [W3C] Matched W3C error code 'no such element' to NoSuchElementError
[debug] [BaseDriver] Waited for 3713 ms so far
[debug] [WD Proxy] Matched '/element' to command name 'findElement'
[debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/element] with body: {"strategy":"-android uiautomator","selector":"new UiSelector().resourceId(\"com.ganji.android:id/navigation_mine_img\")","context":"","multiple":false}
[WD Proxy] Got response with status 404: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"error":"no such element","message":"An element could not be located on the page using the given search parameters","stacktrace":"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: An element could not be located on the page using the given search parameters\n\tat io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:70)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:264)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:258)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.chann...
[debug] [W3C] Matched W3C error code 'no such element' to NoSuchElementError
[debug] [BaseDriver] Waited for 4763 ms so far
[debug] [WD Proxy] Matched '/element' to command name 'findElement'
[debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/element] with body: {"strategy":"-android uiautomator","selector":"new UiSelector().resourceId(\"com.ganji.android:id/navigation_mine_img\")","context":"","multiple":false}
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"ELEMENT":"00000000-0000-010f-ffff-ffff0000007a","element-6066-11e4-a52e-4f735466cecf":"00000000-0000-010f-ffff-ffff0000007a"}}
[debug] [W3C (4af5160b)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"00000000-0000-010f-ffff-ffff0000007a","ELEMENT":"00000000-0000-010f-ffff-ffff0000007a"}
[HTTP] <-- POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/element 200 7728 ms - 137
[HTTP]
[HTTP] --> POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/element/00000000-0000-010f-ffff-ffff0000007a/click
[HTTP] {"id":"00000000-0000-010f-ffff-ffff0000007a"}
[debug] [W3C (4af5160b)] Calling AppiumDriver.click() with args: ["00000000-0000-010f-ffff-ffff0000007a","4af5160b-9962-417c-8735-171ff20349d1"]
[debug] [WD Proxy] Matched '/element/00000000-0000-010f-ffff-ffff0000007a/click' to command name 'click'
[debug] [WD Proxy] Proxying [POST /element/00000000-0000-010f-ffff-ffff0000007a/click] to [POST http://127.0.0.1:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/element/00000000-0000-010f-ffff-ffff0000007a/click] with body: {"element":"00000000-0000-010f-ffff-ffff0000007a"}
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":null}
[debug] [W3C (4af5160b)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/element/00000000-0000-010f-ffff-ffff0000007a/click 200 309 ms - 14
[HTTP]
[HTTP] --> POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/element
[HTTP] {"using":"-android uiautomator","value":"new UiSelector().resourceId(\"com.ganji.android:id/img_user_info_page\")"}
[debug] [W3C (4af5160b)] Calling AppiumDriver.findElement() with args: ["-android uiautomator","new UiSelector().resourceId(\"com.ganji.android:id/img_user_info_page\")","4af5160b-9962-417c-8735-171ff20349d1"]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, css selector, -android uiautomator
[debug] [BaseDriver] Waiting up to 20000 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:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/element] with body: {"strategy":"-android uiautomator","selector":"new UiSelector().resourceId(\"com.ganji.android:id/img_user_info_page\")","context":"","multiple":false}
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"ELEMENT":"00000000-0000-010f-ffff-ffff0000023a","element-6066-11e4-a52e-4f735466cecf":"00000000-0000-010f-ffff-ffff0000023a"}}
[debug] [W3C (4af5160b)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"00000000-0000-010f-ffff-ffff0000023a","ELEMENT":"00000000-0000-010f-ffff-ffff0000023a"}
[HTTP] <-- POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/element 200 1374 ms - 137
[HTTP]
[HTTP] --> POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/element/00000000-0000-010f-ffff-ffff0000023a/click
[HTTP] {"id":"00000000-0000-010f-ffff-ffff0000023a"}
[debug] [W3C (4af5160b)] Calling AppiumDriver.click() with args: ["00000000-0000-010f-ffff-ffff0000023a","4af5160b-9962-417c-8735-171ff20349d1"]
[debug] [WD Proxy] Matched '/element/00000000-0000-010f-ffff-ffff0000023a/click' to command name 'click'
[debug] [WD Proxy] Proxying [POST /element/00000000-0000-010f-ffff-ffff0000023a/click] to [POST http://127.0.0.1:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/element/00000000-0000-010f-ffff-ffff0000023a/click] with body: {"element":"00000000-0000-010f-ffff-ffff0000023a"}
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":null}
[debug] [W3C (4af5160b)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/element/00000000-0000-010f-ffff-ffff0000023a/click 200 145 ms - 14
[HTTP]
[HTTP] --> GET /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/window/rect
[HTTP] {}
[debug] [W3C (4af5160b)] Calling AppiumDriver.getWindowRect() with args: ["4af5160b-9962-417c-8735-171ff20349d1"]
[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:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/window/current/size] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"height":2255,"width":1080}}
[debug] [W3C (4af5160b)] Responding to client with driver.getWindowRect() result: {"width":1080,"height":2255,"x":0,"y":0}
[HTTP] <-- GET /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/window/rect 200 43 ms - 50
[HTTP]
[HTTP] --> GET /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/window/rect
[HTTP] {}
[debug] [W3C (4af5160b)] Calling AppiumDriver.getWindowRect() with args: ["4af5160b-9962-417c-8735-171ff20349d1"]
[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:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/window/current/size] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"height":2255,"width":1080}}
[debug] [W3C (4af5160b)] Responding to client with driver.getWindowRect() result: {"width":1080,"height":2255,"x":0,"y":0}
[HTTP] <-- GET /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/window/rect 200 23 ms - 50
[HTTP]
[HTTP] --> POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/touch/perform
[HTTP] {"actions":[{"action":"press","options":{"x":540,"y":405}},{"action":"wait","options":{"ms":7000}},{"action":"moveTo","options":{"x":540,"y":2142}},{"action":"release","options":{}}]}
[debug] [W3C (4af5160b)] Calling AppiumDriver.performTouch() with args: [[{"action":"press","options":{"x":540,"y":405}},{"action":"wait","options":{"ms":7000}},{"action":"moveTo","options":{"x":540,"y":2142}},{"action":"release","options":{}}],"4af5160b-9962-417c-8735-171ff20349d1"]
[debug] [WD Proxy] Matched '/touch/perform' to command name 'performTouch'
[debug] [WD Proxy] Proxying [POST /touch/perform] to [POST http://127.0.0.1:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/touch/perform] with body: {"startX":540,"startY":405,"endX":540,"endY":2142,"steps":196}
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":null}
[debug] [W3C (4af5160b)] Responding to client with driver.performTouch() result: null
[HTTP] <-- POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/touch/perform 200 4141 ms - 14
[HTTP]
[HTTP] --> POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/element
[HTTP] {"using":"-image","value":"iVBORw0KGgoAAAANSUhEUgAAALIAAAA+CAYAAACP+EHLAAAMbWlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkJDQAhGQEnoTRGoAKSG0ANKLYCMkgYQSY0JQsZdFBdcuoljRVRHFtgJix64sir0viigo66IuNlTehAR03Ve+d75v7v1z5sx/yp3JvQcA7Q88qTQP1QEgX1IgSwgPZo5OS2eSngEEYEAPWAEfHl8uZcfFRQMoA/e/y7tb0BrKdWcl1z/n/6voCYRyPgDIWIgzBXJ+PsQnAcDX86WyAgCISr3V5AKpEs+GWF8GA4R4lRJnq/BOJc5U4aP9NkkJHIivAqBB5fFk2QBoPYB6ZiE/G/JofYbYVSIQSwDQHgZxAF/EE0CsjH1Yfv5EJS6H2B7aSyGG8QBW5nec2X/jzxzk5/GyB7Eqr37RCBHLpXm8qf9naf635OcpBnzYwkEVySISlPnDGt7JnRilxFSIuySZMbHKWkP8QSxQ1R0AlCJSRCSr7FETvpwD6wcYELsKeCFREJtAHCbJi4lW6zOzxGFciOFuQaeIC7hJEBtCvFAoD01U22yWTUxQ+0Jrs2Qctlp/gSfr96v09UiRm8xW878RCblqfkyrSJSUCjEFYutCcUoMxFoQu8hzE6PUNiOLRJyYARuZIkEZvzXECUJJeLCKHyvMkoUlqO1L8uUD+WKbRWJujBofKBAlRajqg53h8/rjh7lgV4USdvIAj1A+OnogF4EwJFSVO9YhlCQnqnk+SAuCE1RrcYo0L05tj1sK88KVekuIPeSFieq1eEoB3JwqfjxLWhCXpIoTL8rhRcap4sGXgWjAASGACRRwZIKJIAeIm7vquuAv1UwY4AEZyAZC4KzWDKxI7Z+RwGsiKAJ/QCQE8sF1wf2zQlAI9V8GtaqrM8jqny3sX5ELnkGcD6JAHvyt6F8lGfSWAp5Cjfgf3nlw8GG8eXAo5/+9fkD7TcOGmmi1RjHgka...
[debug] [W3C (4af5160b)] Calling AppiumDriver.findElement() with args: ["-image","iVBORw0KGgoAAAANSUhEUgAAALIAAAA+CAYAAACP+EHLAAAMbWlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkJDQAhGQEnoTRGoAKSG0ANKLYCMkgYQSY0JQsZdFBdcuoljRVRHFtgJix64sir0viigo66IuNlTehAR03Ve+d75v7v1z5sx/yp3JvQcA7Q88qTQP1QEgX1IgSwgPZo5OS2eSngEEYEAPWAEfHl8uZcfFRQMoA/e/y7tb0BrKdWcl1z/n/6voCYRyPgDIWIgzBXJ+PsQnAcDX86WyAgCISr3V5AKpEs+GWF8GA4R4lRJnq/BOJc5U4aP9NkkJHIivAqBB5fFk2QBoPYB6ZiE/G/JofYbYVSIQSwDQHgZxAF/EE0CsjH1Yfv5EJS6H2B7aSyGG8QBW5nec2X/jzxzk5/GyB7Eqr37RCBHLpXm8qf9naf635OcpBnzYwkEVySISlPnDGt7JnRilxFSIuySZMbHKWkP8QSxQ1R0AlCJSRCSr7FETvpwD6wcYELsKeCFREJtAHCbJi4lW6zOzxGFciOFuQaeIC7hJEBtCvFAoD01U22yWTUxQ+0Jrs2Qctlp/gSfr96v09UiRm8xW878RCblqfkyrSJSUCjEFYutCcUoMxFoQu8hzE6PUNiOLRJyYARuZIkEZvzXECUJJeLCKHyvMkoUlqO1L8uUD+WKbRWJujBofKBAlRajqg53h8/rjh7lgV4USdvIAj1A+OnogF4EwJFSVO9YhlCQnqnk+SAuCE1RrcYo0L05tj1sK88KVekuIPeSFieq1eEoB3JwqfjxLWhCXpIoTL8rhRcap4sGXgWjAASGACRRwZIKJIAeIm7vquuAv1UwY4AEZyAZC4KzWDKxI7Z+RwGsiKAJ/QCQE8sF1wf2zQlAI9V8GtaqrM8jqny3sX5ELnkGcD6JAHvyt6F8lGfSWAp5Cjfgf3nlw8GG8eXAo5/+9fkD7TcOGmmi1RjHgkak9YEkMJYYQI4hhRA...
[BaseDriver] Finding image element with match threshold 0.4
[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:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/window/current/size] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":{"height":2255,"width":1080}}
[debug] [BaseDriver] Waiting up to 20000 ms for condition
[debug] [WD Proxy] Matched '/screenshot' to command name 'getScreenshot'
[debug] [WD Proxy] Proxying [GET /screenshot] to [GET http://127.0.0.1:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c/screenshot] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":"iVBORw0KGgoAAAANSUhEUgAABDgAAAkkCAYAAAD508+vAAAAAXNSR0IArs4c6QAAAARzQklUCAgI\nCHwIZIgAACAASURBVHic7L15tC3HWR/6q969e89nn33Ge84ddaWrK8m2ZEseJBtbRrIZ/SBkwYK1\nkpD1SEIgvPcchgAJSch7hOUwhDEEWCTBBB5egYRpAQYs2SDrYQvZV7YuuhrufO6598zDnqfeXe+P\n7q6uqq7uPZ1JUv2kfc/uGr76qvbeXV/9+quvyM8++RUUGkcKY38gfQRQRQEacSGXpPzfUDkqluHz\naVCO8uUo4EhaOVxZUOrluzIoghco5dLc+v414MmlYjp70aDF+HKBrnxdX2O+X3y5cJ/DYxh+T9w3\nBBEgQR5XhhDiJXn5hF151yQo4+cRdgFC3GtC3PrEL09cKcQACAwuzy8bvA9e6msQAmKE89GnfqhN\npk/QBz9fzAvq+v0mIIDB9d/vO7gxCy64NvnhZxX5P+L485+YcC3nE7l4uLwM+SsS912JgUrXwWsP\nUqBPdTKmgP3EuH3bGy1e1xq8PnG4ptB+z/uHCdEyiCwwen7f6vECaF/50QVi69LQm9i6VE7kDC2V\nKL5flKrqULG8Z4ywepSTztlTfoZoZ1G/mGcvUdc+8tM8e8hNC+pQx6/rlufLOJSTTx33r2cAOpQC\njlcHbjpVyvB1EPPDeW4b7Bp+W0F5JpfrN+sXS+PH1K/Lj7VoFFI+TXpL5ATIeeLdXH4vlyFETifi\ntWgiBvleAYOlB7ZR+L0izatnsFYDm4vZWnJ9vyyBoIOvq8Hbsax+YLcEfYgeryA/bGsJZSOmTCK9\nG9Hc6gs9Y+8PzMNWQEPjqOMI240cFAtWebGtqsUW+OI04r4jwixCBCEcqcCliyQL2GxGuImGz2fk\nha8CTzgIEyRhbQZtkEB/Xh+O...
[BaseDriver] Verifying screenshot size and aspect ratio
[BaseDriver] When trying to find an element, determined that the screen aspect ratio and screenshot aspect ratio are different. Screen is 1080x2255 whereas screenshot is 1080x2340.
[BaseDriver] Resizing screenshot to 1080x2340 to match screen aspect ratio so that image element coordinates have a greater chance of being correct.
dbug Support Initializing opencv
dbug Support Loading local package 'opencv4nodejs'
dbug Support Failed to load local package 'opencv4nodejs': Cannot find module 'opencv4nodejs'
dbug Support Require stack:
dbug Support - /opt/homebrew/lib/node_modules/appium/node_modules/appium-support/build/lib/node.js
dbug Support - /opt/homebrew/lib/node_modules/appium/node_modules/appium-support/build/lib/image-util.js
dbug Support - /opt/homebrew/lib/node_modules/appium/node_modules/appium-support/build/index.js
dbug Support - /opt/homebrew/lib/node_modules/appium/build/lib/logsink.js
dbug Support - /opt/homebrew/lib/node_modules/appium/build/lib/main.js
dbug Support Failed to load global package 'opencv4nodejs': The "path" argument must be of type string. Received undefined
dbug Support Linking package 'opencv4nodejs'
dbug Support Retrying load of linked package 'opencv4nodejs'
ERR! Support Unable to load package 'opencv4nodejs': Cannot find module 'opencv4nodejs'
ERR! Support Require stack:
ERR! Support - /opt/homebrew/lib/node_modules/appium/node_modules/appium-support/build/lib/node.js
ERR! Support - /opt/homebrew/lib/node_modules/appium/node_modules/appium-support/build/lib/image-util.js
ERR! Support - /opt/homebrew/lib/node_modules/appium/node_modules/appium-support/build/index.js
ERR! Support - /opt/homebrew/lib/node_modules/appium/build/lib/logsink.js
ERR! Support - /opt/homebrew/lib/node_modules/appium/build/lib/main.js
WARN Support Unable to load 'opencv4nodejs': Unable to load package 'opencv4nodejs': Cannot find module 'opencv4nodejs'
WARN Support Require stack:
WARN Support - /opt/homebrew/lib/node_modules/appium/node_modules/appium-support/build/lib/node.js
WARN Support - /opt/homebrew/lib/node_modules/appium/node_modules/appium-support/build/lib/image-util.js
WARN Support - /opt/homebrew/lib/node_modules/appium/node_modules/appium-support/build/index.js
WARN Support - /opt/homebrew/lib/node_modules/appium/build/lib/logsink.js
WARN Support - /opt/homebrew/lib/node_modules/appium/build/lib/main.js
[debug] [W3C (4af5160b)] Encountered internal error running command: Error: 'opencv4nodejs' module is required to use OpenCV features. Please install it first ('npm i -g opencv4nodejs') and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.
[debug] [W3C (4af5160b)] at initOpenCV (/opt/homebrew/lib/node_modules/appium/node_modules/appium-support/lib/image-util.js:137:11)
[debug] [W3C (4af5160b)] at Object.getImageOccurrence (/opt/homebrew/lib/node_modules/appium/node_modules/appium-support/lib/image-util.js:498:3)
[debug] [W3C (4af5160b)] at AndroidUiautomator2Driver.compareImages (/opt/homebrew/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/images.js:62:16)
[debug] [W3C (4af5160b)] at condition (/opt/homebrew/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:257:22)
[debug] [W3C (4af5160b)] at wrappedCondFn (/opt/homebrew/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/timeout.js:151:12)
[debug] [W3C (4af5160b)] at spin (/opt/homebrew/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:138:20)
[debug] [W3C (4af5160b)] at waitForCondition (/opt/homebrew/lib/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:155:10)
[debug] [W3C (4af5160b)] at AndroidUiautomator2Driver.implicitWaitForCondition (/opt/homebrew/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/timeout.js:153:10)
[debug] [W3C (4af5160b)] at AndroidUiautomator2Driver.findByImage (/opt/homebrew/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:277:5)
[debug] [W3C (4af5160b)] at AndroidUiautomator2Driver.findElement (/opt/homebrew/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:48:12)
[HTTP] <-- POST /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1/element 500 4146 ms - 967
[HTTP]
[HTTP] --> DELETE /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1
[HTTP] {}
[debug] [W3C (4af5160b)] Calling AppiumDriver.deleteSession() with args: ["4af5160b-9962-417c-8735-171ff20349d1"]
[debug] [BaseDriver] Event 'quitSessionRequested' logged at 1644911862401 (15:57:42 GMT+0800 (中国标准时间))
[Appium] Removing session 4af5160b-9962-417c-8735-171ff20349d1 from our master session list
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [WD Proxy] Matched '/' to command name 'deleteSession'
[debug] [WD Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:8200/wd/hub/session/c05e0310-3eb2-4804-8aba-43ad3320ae2c] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"c05e0310-3eb2-4804-8aba-43ad3320ae2c","value":null}
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 shell am force-stop com.ganji.android'
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8200
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 forward --remove tcp:8200'
[UiAutomator2] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running '/Users/zhengxiangyu/Library/Android/sdk/platform-tools/adb -P 5037 -s 7XBRX18C21004820 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy''
[debug] [BaseDriver] Event 'quitSessionFinished' logged at 1644911862799 (15:57:42 GMT+0800 (中国标准时间))
[debug] [W3C (4af5160b)] Received response: null
[debug] [W3C (4af5160b)] But deleting session, so not returning
[debug] [W3C (4af5160b)] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /wd/hub/session/4af5160b-9962-417c-8735-171ff20349d1 200 401 ms - 14
[HTTP]
[debug] [Instrumentation] .
[debug] [Instrumentation] Time: 27.138
[debug] [Instrumentation]
[debug] [Instrumentation] OK (1 test)
[debug] [Instrumentation] The process has exited with code 0
校长,这个问题有结果了么
这两天有点忙,一直没顾得上试,最迟明天我用你的代码排查下。
好的,谢谢校长……
------------------这个是Capabilities信息-------------
desiredCapabilities.setCapability(“platformName”, “Android”);
desiredCapabilities.setCapability(“udid”, “7XBRX18C21004820”);
desiredCapabilities.setCapability(“appPackage”, “com.ganji.android”);
desiredCapabilities.setCapability(“appActivity”, “com.wuba.activity.launch.LaunchActivity”);
desiredCapabilities.setCapability(“ensureWebviewsHavePages”, true);
desiredCapabilities.setCapability(“nativeWebScreenshot”, true);
desiredCapabilities.setCapability(“noReset”, true);
校长,这个问题现在有结论了吗
我这是可以的,建议你重新安装下opencv4nodejs,我怀疑是你没安装好。安装这个东西需要代理和编译,可能安装时候报错了但是你没注意到。
@Test
public void testOpenCV() throws InterruptedException, IOException {
WebElement myPointView = driver.findElement(AppiumBy.image(getImageAsBase64String("myPointView")));
myPointView.click();
}
private String getImageAsBase64String(String imageName) throws IOException {
return Base64.getEncoder().encodeToString(Files.readAllBytes(Path.of("/Users/seveniruby/Dropbox/sihanjishu/startup/霍格沃兹测试学院/banner/440.jpeg")));
}
你检查下opencv相关的命令能否运行
https://github.com/justadudewhohacks/opencv4nodejs#how-to-install
我的安装步骤:
brew update
brew install opencv@4
brew link --force opencv@4
npm install --save opencv4nodejs
是不是M1芯片的笔记本不能这么装呢?校长有这方面的安装教程么
参考这里的帮助,你运行下opencv的对应的命令吧,确保能正常的运行。
好,我试试,另外,咱们能出一个M1本和inter本的常用环境差别么,公司配的M1本装软件经常有各种问题
如果你的appium是全局的,你应该使用 npm install -g opencv4nodejs
我写了一个帖子可以参考下过程,主要是安装复杂
对,就是安装太磨人了
你自己执行下就行了,其实就是你的npm的包的安装路径
ceshiren.com: chromedrivers seveniruby$ npm root -g
/usr/local/lib/node_modules
好滴好滴,谢谢校长