Appium 關於微信 H5 頁面切換 webview 的問題

zhouzhou123發表於2024-10-21

Appium 進行微信小程式自動化測試,碰到切換 webview 後定位不到 H5 頁面 元素問題
以下是我做的前提準備以及一些程式碼, 請問大神 哪裡有問題?

1.開啟微信除錯功能
#1.開啟微信除錯功能
http://debugxweb.qq.com/?inspector=true
2.在電腦中安裝 chromedriver
#2.在電腦中安裝 chromedriver
幫我看看 我的 微信裡面的 webview 版本號 122.0.6261.120 和 chromedriver 的版本號 120.0.6099.109 對應的關係對不對??

我這裡安裝的是這個版本,Version:120.0.6099.109(r1217362)

【chromedriver 下載連結地址:參考文獻;https://zhuanlan.zhihu.com/p/657653897
手機上面檢視
{
"user-agent": "Mozilla/5.0 (Linux; Android 9; V1941A Build/PKQ1.190302.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/122.0.6261.120 Mobile Safari/537.36 XWEB/1220053 MMWEBSDK/20240404 MMWEBID/2626 MicroMessenger/8.0.49.2600(0x2800313D) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64"
}

3.以下是 python 和 appium 程式碼

aps = {}

         caps["platformName"] = "android"
         caps["deviceName"] = "aa"
         caps["appPackage"] = "com.tencent.mm"
         caps["appActivity"] =".ui.LauncherUI"
         caps['noReset']=True
         caps['unicodeKeyboard']=True
         caps['resetKeyboard']=True
         options = selenium.webdriver.ChromeOptions()
         options.add_experimental_option('androidProcess', 'com.tencent.mm:appbrand0')
         caps['ChromeOptions.CAPABILITY'] = 'options'
         caps['chromedriverExecutable']='D:\chromedriver-win64\chromedriver.exe'
         self._driver = webdriver.Remote("http://localhost:4723/wd/hub", caps)
         self._driver.implicitly_wait(10)

         # 嘗試強制切換到 WebView 上下文
         try:
             self._driver.switch_to.context('WEBVIEW_com.tencent.mm:appbrand0')
             print(f"Current context: {self._driver.current_context}")
         except Exception as e:
             print(f"Failed to switch to WEBVIEW: {e}")
         time.sleep(10)  # 等待頁面載入
         contexts = self._driver.contexts
         print(f"Available contexts: {contexts}")


           # 確認當前URL和Title
         current_url = self._driver.execute_script("return window.location.href;")
         current_title = self._driver.execute_script("return document.title;")
         print(f"Current URL: {current_url}")
         print(f"Current Title: {current_title}")

4.列印可用的 contexts 和當前的 WebView
這裡可用的 contexts 有 2 個
Available contexts: ['NATIVE_APP', 'WEBVIEW_com.tencent.mm:appbrand0']
Current context: WEBVIEW_com.tencent.mm:appbrand0

5.嘗試強制切換到 WebView 上下文後; 這裡很奇怪 為什麼 切換 WEBVIEW 後 檢視當前可用的 contexts 有 3 個
Available contexts: ['NATIVE_APP', 'WEBVIEW_com.tencent.mm', 'WEBVIEW_com.tencent.mm:appbrand0']
Current context: WEBVIEW_com.tencent.mm:appbrand0

6.確認當前 URL 和 Title
current_url = self._driver.execute_script("return window.location.href;")
current_title = self._driver.execute_script("return document.title;")
print(f"Current URL: {current_url}")
print(f"Current Title: {current_title}")

以下是列印出來的結果
Current URL: https://servicewechat.com/preload/page-frame.html

Current Title:

  1. 這裡是分析原因 https://servicewechat.com/preload/page-frame.html 是與微信小程式相關的 URL。這個連結指向的頁面是微信小程式內部的一個預載入框架。微信小程式在執行時會載入這個頁面作為基礎架構的一部分,它通常包含小程式執行環境的初始程式碼和框架。這個頁面不是使用者直接訪問的網頁,而是微信小程式平臺內部工作的一部分,用於支援小程式的渲染和功能。 微信小程式的工作原理是將各個頁面的程式碼包在執行時動態載入到這個預載入框架中,從而實現小程式的頁面切換和功能執行。因此,當你看到錯誤資訊中提到這個 URL 時,通常意味著小程式在嘗試載入或執行程式碼時遇到了問題,可能是由於資源載入失敗、版本不匹配、程式碼錯誤或者是白名單配置不正確等原因導致的。

8.以下是 appium 日誌
#

[HTTP] <-- GET /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/source 200 299 ms - 594
[HTTP]
[HTTP] --> GET /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/contexts
[HTTP] {}
[W3C (93535157)] Calling AppiumDriver.getContexts() with args: ["93535157-2cce-439e-b78c-4ca48e080be2"]
[AndroidDriver] Getting a list of available webviews
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 shell cat /proc/net/unix'
[AndroidDriver] Parsed 1 active devtools socket: ["@webview_devtools_remote_32198"]
[AndroidDriver] Collecting CDP data of 1 webview
[AndroidDriver] Forwarding remote port webview_devtools_remote_32198 to a local port in range 10900..11000
[AndroidDriver] You could use the 'webviewDevtoolsPort' capability to customize the starting port number
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 forward tcp:10900 localabstract:webview_devtools_remote_32198'
[ADB] Removing forwarded port socket connection: 10900
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 forward --remove tcp:10900'
[AndroidDriver] CDP data collection completed
[AndroidDriver] WEBVIEW_32198 mapped to pid 32198
[AndroidDriver] Getting process name for webview 'WEBVIEW_32198'
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 shell ps --help'
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 shell ps -A'
[AndroidDriver] Got process name: 'com.tencent.mm:appbrand0'
[AndroidDriver] Found 1 webview: ["WEBVIEW_com.tencent.mm:appbrand0"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.tencent.mm:appbrand0"]
[W3C (93535157)] Responding to client with driver.getContexts() result: ["NATIVE_APP","WEBVIEW_com.tencent.mm:appbrand0"]
[HTTP] <-- GET /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/contexts 200 1031 ms - 59
[HTTP]
[HTTP] --> POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/context
[HTTP] {"name":"WEBVIEW_com.tencent.mm:appbrand0"}
[W3C (93535157)] Calling AppiumDriver.setContext() with args: ["WEBVIEW_com.tencent.mm:appbrand0","93535157-2cce-439e-b78c-4ca48e080be2"]
[AndroidDriver] Getting a list of available webviews
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 shell cat /proc/net/unix'
[AndroidDriver] Parsed 1 active devtools socket: ["@webview_devtools_remote_32198"]
[AndroidDriver] Collecting CDP data of 1 webview
[AndroidDriver] Forwarding remote port webview_devtools_remote_32198 to a local port in range 10900..11000
[AndroidDriver] You could use the 'webviewDevtoolsPort' capability to customize the starting port number
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 forward tcp:10900 localabstract:webview_devtools_remote_32198'
[ADB] Removing forwarded port socket connection: 10900
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 forward --remove tcp:10900'
[AndroidDriver] CDP data collection completed
[AndroidDriver] WEBVIEW_32198 mapped to pid 32198
[AndroidDriver] Getting process name for webview 'WEBVIEW_32198'
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 shell ps -A'
[AndroidDriver] Got process name: 'com.tencent.mm:appbrand0'
[AndroidDriver] Found 1 webview: ["WEBVIEW_com.tencent.mm:appbrand0"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.tencent.mm:appbrand0"]
[AndroidDriver] Connecting to chrome-backed webview context 'WEBVIEW_com.tencent.mm:appbrand0'
[AndroidDriver] A port was not given, using random free port: 8003
[AndroidDriver] Passing web view details to the Chromedriver constructor: {
[AndroidDriver] "info": {
[AndroidDriver] "Android-Package": "com.tencent.mm",
[AndroidDriver] "Browser": "Chrome/122.0.6261.120",
[AndroidDriver] "Protocol-Version": "1.3",
[AndroidDriver] "User-Agent": "Mozilla/5.0 (Linux; Android 9; V1941A Build/PKQ1.190302.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/122.0.6261.120 Mobile Safari/537.36 XWEB/1220053 MMWEBSDK/20240404",
[AndroidDriver] "V8-Version": "12.2.281.22",
[AndroidDriver] "WebKit-Version": "537.36 (@user373203561d8d34ecaac0d)",
[AndroidDriver] "webSocketDebuggerUrl": "ws://127.0.0.1:10900/devtools/browser"
[AndroidDriver] },
[AndroidDriver] "process": {
[AndroidDriver] "name": "com.tencent.mm:appbrand0",
[AndroidDriver] "id": "32198"
[AndroidDriver] }
[AndroidDriver] }
[AndroidDriver] Precalculated Chromedriver capabilities: {
[AndroidDriver] "androidPackage": "com.tencent.mm",
[AndroidDriver] "androidUseRunningApp": true,
[AndroidDriver] "androidProcess": "com.tencent.mm:appbrand0",
[AndroidDriver] "androidDeviceSerial": "aa49af08"
[AndroidDriver] }
[AndroidDriver] Before starting chromedriver, androidPackage is 'com.tencent.mm'
[Chromedriver] Changed state to 'starting'
[Chromedriver] Set chromedriver binary as: D:\chromedriver-win64\chromedriver.exe
[Chromedriver] Killing any old chromedrivers, running: wmic process where "commandline like '%chromedriver.exe%--port=8003%'" delete
[Chromedriver] Successfully cleaned up old chromedrivers
[Chromedriver] Cleaning this device's adb forwarded port socket connections: aa49af08
[ADB] List forwarding ports
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 forward --list'
[ADB] Removing forwarded port socket connection: 55334
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 forward --remove tcp:55334'
[Chromedriver] Spawning chromedriver with: D:\chromedriver-win64\chromedriver.exe --url-base=wd/hub --port=8003 --adb-port=5037 --verbose
[Chromedriver] Chromedriver version: '122.0.6261.128'
[WD Proxy] Matched '/status' to command name 'getStatus'
[WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8003/wd/hub/status] with no body
[WD Proxy] Got response with status 200: {"value":{"build":{"version":"122.0.6261.128 (f18a44fedeb29764b2b5336c120fdd90ef1a3f5c-refs/branch-heads/6261@{#1057})"},"message":"ChromeDriver ready for new sessions.","os":{"arch":"x86_64","name":"Windows NT","version":"10.0.19044"},"ready":true}}
[Chromedriver] Starting W3C Chromedriver session with capabilities: {
[Chromedriver] "capabilities": {
[Chromedriver] "alwaysMatch": {
[Chromedriver] "goog:chromeOptions": {
[Chromedriver] "androidPackage": "com.tencent.mm",
[Chromedriver] "androidUseRunningApp": true,
[Chromedriver] "androidProcess": "com.tencent.mm:appbrand0",
[Chromedriver] "androidDeviceSerial": "aa49af08"
[Chromedriver] },
[Chromedriver] "goog:loggingPrefs": {
[Chromedriver] "browser": "ALL"
[Chromedriver] }
[Chromedriver] }
[Chromedriver] }
[Chromedriver] }
[WD Proxy] Matched '/session' to command name 'createSession'
[WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8003/wd/hub/session] with body: {"capabilities":{"alwaysMatch":{"goog:chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"androidProcess":"com.tencent.mm:appbrand0","androidDeviceSerial":"aa49af08"},"goog:loggingPrefs":{"browser":"ALL"}}}}
[Chromedriver] Webview version: 'Chrome/122.0.6261.120'
[WD Proxy] Got response with status 200: {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"122.0.6261.120","chrome":{"chromedriverVersion":"122.0.6261.128 (f18a44fedeb29764b2b5336c120fdd90ef1a3f5c-refs/branch-heads/6261@{#1057})"},"fedcm:accounts":true,"goog:chromeOptions":{"debuggerAddress":"localhost:49741"},"pageLoadStrategy":"normal","platformName":"android","proxy":{},"setWindowRect":false,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:extension:credBlob":false,"webauthn:extension:largeBlob":false,"webauthn:extension:minPinLength":false,"webauthn:extension:prf":false,"webauthn:virtualAuthenticators":false},"sessionId":"6b32cdbd1a1b226e93eec6104c18a90d"}}
[WD Proxy] Determined the downstream protocol as 'W3C'
[Chromedriver] Changed state to 'online'
[W3C (93535157)] Responding to client with driver.setContext() result: null
[HTTP] <-- POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/context 200 3582 ms - 14
[HTTP]
[HTTP] --> GET /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/context
[HTTP] {}
[W3C (93535157)] Calling AppiumDriver.getCurrentContext() with args: ["93535157-2cce-439e-b78c-4ca48e080be2"]
[W3C (93535157)] Responding to client with driver.getCurrentContext() result: "WEBVIEW_com.tencent.mm:appbrand0"
[HTTP] <-- GET /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/context 200 1 ms - 44
[HTTP]
[HTTP] --> GET /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/contexts
[HTTP] {}
[W3C (93535157)] Calling AppiumDriver.getContexts() with args: ["93535157-2cce-439e-b78c-4ca48e080be2"]
[AndroidDriver] Getting a list of available webviews
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 shell cat /proc/net/unix'
[AndroidDriver] Parsed 2 active devtools sockets: ["@webview_devtools_remote_31937","@webview_devtools_remote_32198"]
[AndroidDriver] Collecting CDP data of 2 webviews
[AndroidDriver] Forwarding remote port webview_devtools_remote_31937 to a local port in range 10900..11000
[AndroidDriver] You could use the 'webviewDevtoolsPort' capability to customize the starting port number
[AndroidDriver] Forwarding remote port webview_devtools_remote_32198 to a local port in range 10900..11000
[AndroidDriver] You could use the 'webviewDevtoolsPort' capability to customize the starting port number
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 forward tcp:10900 localabstract:webview_devtools_remote_31937'
[ADB] Removing forwarded port socket connection: 10900
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 forward --remove tcp:10900'
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 forward tcp:10900 localabstract:webview_devtools_remote_32198'
[ADB] Removing forwarded port socket connection: 10900
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 forward --remove tcp:10900'
[AndroidDriver] CDP data collection completed
[AndroidDriver] WEBVIEW_31937 mapped to pid 31937
[AndroidDriver] Getting process name for webview 'WEBVIEW_31937'
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 shell ps -A'
[AndroidDriver] Got process name: 'com.tencent.mm'
[AndroidDriver] WEBVIEW_32198 mapped to pid 32198
[AndroidDriver] Getting process name for webview 'WEBVIEW_32198'
[ADB] Running 'C:\Users\junfei\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s aa49af08 shell ps -A'
[AndroidDriver] Got process name: 'com.tencent.mm:appbrand0'
[AndroidDriver] Found 2 webviews: ["WEBVIEW_com.tencent.mm","WEBVIEW_com.tencent.mm:appbrand0"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.tencent.mm","WEBVIEW_com.tencent.mm:appbrand0"]
[W3C (93535157)] Responding to client with driver.getContexts() result: ["NATIVE_APP","WEBVIEW_com.tencent.mm","WEBVIEW_com.tencent.mm:appbrand0"]
[HTTP] <-- GET /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/contexts 200 1640 ms - 84
[HTTP]
[HTTP] --> GET /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/context
[HTTP] {}
[W3C (93535157)] Calling AppiumDriver.getCurrentContext() with args: ["93535157-2cce-439e-b78c-4ca48e080be2"]
[W3C (93535157)] Responding to client with driver.getCurrentContext() result: "WEBVIEW_com.tencent.mm:appbrand0"
[HTTP] <-- GET /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/context 200 1 ms - 44
[HTTP]
[HTTP] --> GET /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/source
[HTTP] {}
[W3C (93535157)] Driver proxy active, passing request on via HTTP proxy
[WD Proxy] Matched '/wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/source' to command name 'getPageSource'
[WD Proxy] Proxying [GET /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/source] to [GET http://127.0.0.1:8003/wd/hub/session/6b32cdbd1a1b226e93eec6104c18a90d/source] with no body
[WD Proxy] Got response with status 200: {"value":"
[HTTP] <-- GET /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/source 200 116 ms - 282721
[HTTP]
[HTTP] --> POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/execute/sync
[HTTP] {"script":"return window.location.href;","args":[]}
[W3C (93535157)] Calling AppiumDriver.execute() with args: ["return window.location.href;",[],"93535157-2cce-439e-b78c-4ca48e080be2"]
[WD Proxy] Matched '/execute/sync' to command name 'execute'
[Protocol Converter] Did not know how to rewrite the original URL '/execute/sync' for W3C protocol
[WD Proxy] Proxying [POST /execute/sync] to [POST http://127.0.0.1:8003/wd/hub/session/6b32cdbd1a1b226e93eec6104c18a90d/execute/sync] with body: {"script":"return window.location.href;","args":[]}
[WD Proxy] Got response with status 200: {"value":"https://servicewechat.com/preload/page-frame.html"}
[W3C (93535157)] Responding to client with driver.execute() result: "https://servicewechat.com/preload/page-frame.html"
[HTTP] <-- POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/execute/sync 200 79 ms - 61
[HTTP]
[HTTP] --> POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/execute/sync
[HTTP] {"script":"return document.title;","args":[]}
[W3C (93535157)] Calling AppiumDriver.execute() with args: ["return document.title;",[],"93535157-2cce-439e-b78c-4ca48e080be2"]
[WD Proxy] Matched '/execute/sync' to command name 'execute'
[Protocol Converter] Did not know how to rewrite the original URL '/execute/sync' for W3C protocol
[WD Proxy] Proxying [POST /execute/sync] to [POST http://127.0.0.1:8003/wd/hub/session/6b32cdbd1a1b226e93eec6104c18a90d/execute/sync] with body: {"script":"return document.title;","args":[]}
[WD Proxy] Got response with status 200: {"value":""}
[W3C (93535157)] Responding to client with driver.execute() result: ""
[HTTP] <-- POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/execute/sync 200 52 ms - 12
[HTTP]
[HTTP] --> POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/element
[HTTP] {"using":"xpath","value":"//[@id=\"app\"]/div/div[2]/button/div/span"}
[W3C (93535157)] Driver proxy active, passing request on via HTTP proxy
[WD Proxy] Matched '/wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/element' to command name 'findElement'
[WD Proxy] Proxying [POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/element] to [POST http://127.0.0.1:8003/wd/hub/session/6b32cdbd1a1b226e93eec6104c18a90d/element] with body: {"using":"xpath","value":"//
[@id=\"app\"]/div/div[2]/button/div/span"}
[WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//[@id=\"app\"]/div/div[2]/button/div/span\"}\n (Session info: chrome=122.0.6261.120)","stacktrace":"\tGetHandleVerifier [0x00007FF614F6AD02+56930]\n\t(No symbol) [0x00007FF614EDF602]\n\t(No symbol) [0x00007FF614D942E5]\n\t(No symbol) [0x00007FF614DD98ED]\n\t(No symbol) [0x00007FF614DD9A2C]\n\t(No symbol) [0x00007FF614E1A967]\n\t(No symbol) [0x00007FF614DFBCDF]\n\t(No symbol) [0x00007FF614E181E2]\n\t(No symbol) [0x00007FF614DFBA43]\n\t(No symbol) [0x00007FF614DCD438]\n\t(No symbol) [0x00007FF614DCE4D1]\n\tGetHandleVerifier [0x00007FF6152E6F8D+3711213]\n\tGetHandleVerifier [0x00007FF6153404CD+4077101]\n\tGetHandleVerifier [0x00007FF61533865F+4044735]\n\tGetHandleVerifier [0x00007FF615009736+706710]\n\t(No symbol) [0x00007FF614EEB8DF]\n\t(No symbol) [0x00007FF614EE6AC4]\n\t(No symbol) [0x00007FF614EE6C1C]\n\t(No symbol) [0x00007FF614ED68D4]\n\tBaseThreadInitThunk [0x00007FF82004761...
[W3C] Matched W3C error code 'no such element' to NoSuchElementError
[HTTP] <-- POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/element 404 112 ms - 1077
[HTTP]
[HTTP] --> POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/element
[HTTP] {"using":"xpath","value":"//
[@id=\"app\"]/div/div[2]/button/div/span"}
[W3C (93535157)] Driver proxy active, passing request on via HTTP proxy
[WD Proxy] Matched '/wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/element' to command name 'findElement'
[WD Proxy] Proxying [POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/element] to [POST http://127.0.0.1:8003/wd/hub/session/6b32cdbd1a1b226e93eec6104c18a90d/element] with body: {"using":"xpath","value":"//[@id=\"app\"]/div/div[2]/button/div/span"}
[WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//
[@id=\"app\"]/div/div[2]/button/div/span\"}\n (Session info: chrome=122.0.6261.120)","stacktrace":"\tGetHandleVerifier [0x00007FF614F6AD02+56930]\n\t(No symbol) [0x00007FF614EDF602]\n\t(No symbol) [0x00007FF614D942E5]\n\t(No symbol) [0x00007FF614DD98ED]\n\t(No symbol) [0x00007FF614DD9A2C]\n\t(No symbol) [0x00007FF614E1A967]\n\t(No symbol) [0x00007FF614DFBCDF]\n\t(No symbol) [0x00007FF614E181E2]\n\t(No symbol) [0x00007FF614DFBA43]\n\t(No symbol) [0x00007FF614DCD438]\n\t(No symbol) [0x00007FF614DCE4D1]\n\tGetHandleVerifier [0x00007FF6152E6F8D+3711213]\n\tGetHandleVerifier [0x00007FF6153404CD+4077101]\n\tGetHandleVerifier [0x00007FF61533865F+4044735]\n\tGetHandleVerifier [0x00007FF615009736+706710]\n\t(No symbol) [0x00007FF614EEB8DF]\n\t(No symbol) [0x00007FF614EE6AC4]\n\t(No symbol) [0x00007FF614EE6C1C]\n\t(No symbol) [0x00007FF614ED68D4]\n\tBaseThreadInitThunk [0x00007FF82004761...
[W3C] Matched W3C error code 'no such element' to NoSuchElementError
[HTTP] <-- POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/element 404 77 ms - 1077
[HTTP]
[HTTP] --> POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/element
[HTTP] {"using":"xpath","value":"//[@id=\"app\"]/div/div[2]/button/div/span"}
[W3C (93535157)] Driver proxy active, passing request on via HTTP proxy
[WD Proxy] Matched '/wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/element' to command name 'findElement'
[WD Proxy] Proxying [POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/element] to [POST http://127.0.0.1:8003/wd/hub/session/6b32cdbd1a1b226e93eec6104c18a90d/element] with body: {"using":"xpath","value":"//
[@id=\"app\"]/div/div[2]/button/div/span"}
[WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//*[@id=\"app\"]/div/div[2]/button/div/span\"}\n (Session info: chrome=122.0.6261.120)","stacktrace":"\tGetHandleVerifier [0x00007FF614F6AD02+56930]\n\t(No symbol) [0x00007FF614EDF602]\n\t(No symbol) [0x00007FF614D942E5]\n\t(No symbol) [0x00007FF614DD98ED]\n\t(No symbol) [0x00007FF614DD9A2C]\n\t(No symbol) [0x00007FF614E1A967]\n\t(No symbol) [0x00007FF614DFBCDF]\n\t(No symbol) [0x00007FF614E181E2]\n\t(No symbol) [0x00007FF614DFBA43]\n\t(No symbol) [0x00007FF614DCD438]\n\t(No symbol) [0x00007FF614DCE4D1]\n\tGetHandleVerifier [0x00007FF6152E6F8D+3711213]\n\tGetHandleVerifier [0x00007FF6153404CD+4077101]\n\tGetHandleVerifier [0x00007FF61533865F+4044735]\n\tGetHandleVerifier [0x00007FF615009736+706710]\n\t(No symbol) [0x00007FF614EEB8DF]\n\t(No symbol) [0x00007FF614EE6AC4]\n\t(No symbol) [0x00007FF614EE6C1C]\n\t(No symbol) [0x00007FF614ED68D4]\n\tBaseThreadInitThunk [0x00007FF82004761...
[W3C] Matched W3C error code 'no such element' to NoSuchElementError
[HTTP] <-- POST /wd/hub/session/93535157-2cce-439e-b78c-4ca48e080be2/element 404 85 ms - 1077

相關文章