Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【 iOS 】获取 Hybrid 页面元素时,发现找不到元素。通过打印日志发现,获取到的 driver 只有 Native,没有 WebDriver #872

Open
whapviii opened this issue Nov 19, 2018 · 8 comments
Labels

Comments

@whapviii
Copy link

whapviii commented Nov 19, 2018

  • Macaca Version: 2.1.3
  • Operate System: macOS 10.13.6
  • Programming Language: js

在 iOS 设备 Safari 浏览器中,获取 WebView 页面元素时,发现定位不到元素。通过打印日志发现,获取到的 driver 只有 NATIVE_APP,没有 WebDriver,提示 『'Cannot find any Webview'』

  • Case 说明:
  1. iOS 设备 Safari 浏览器中,打开 WebView 页面
  2. 查找页面中的元素,并进行操作
  • Case Demo:
    image

  • Case结果:
    Logs 输出 :contexts: ["NATIVE_APP"],没有 webview

@xudafeng 求支持

@macaca-bot
Copy link

This is the translated issue:


[ios] When I get a Hybrid page element, I found that I could not find the element. By printing the log, the driver obtained is only native, no WebDriver

  • Macaca Version: 2.1.3
  • Operate System: macOS 10.13.6
  • Programming Language: js

[ios] When I get a Hybrid page element, I found that I could not find the element. By printing the log, the driver obtained is only native, there is no WebDriver, and the prompt "'Cannot find any Webview'"

@whapviii whapviii changed the title 【 ios 】获取 Hybrid 页面元素时,发现找不到元素。通过打印日志发现,获取到的 driver 只有 native,没有 WebDriver 【 ios 】获取 Hybrid 页面元素时,发现找不到元素。通过打印日志发现,获取到的 driver 只有 Native,没有 WebDriver Nov 20, 2018
@whapviii whapviii changed the title 【 ios 】获取 Hybrid 页面元素时,发现找不到元素。通过打印日志发现,获取到的 driver 只有 Native,没有 WebDriver 【 iOS 】获取 Hybrid 页面元素时,发现找不到元素。通过打印日志发现,获取到的 driver 只有 Native,没有 WebDriver Nov 20, 2018
@zyq198764
Copy link

我也遇到同样的问题,现在无法操作ios webview,已经找了很久的问题了,还没有解决,求回复

@macaca-bot
Copy link

This is the translated issue comment: @zyq198764


I also encountered the same problem, can not operate ios webview now, has been looking for a long time, and has not resolved, ask for a reply

@xudafeng
Copy link
Member

macaca doctor?

@louiseyang
Copy link

+1

在 webview 页面获取 contexts 时日志如下:

responseHandler.js:49:14 [master] pid:8508 Send HTTP Respone to Client[2019-01-21 13:45:16]: {"sessionId":"7a2aa959-5aa3-4bf2-9066-285c9910fb1b","status":0,"value":"{"platformName":"iOS","deviceName":"UITest-simulator","bundleId":"com.xxxx.xxxx"}"}
responseHandler.js:11:12 [master] pid:8508 Recieve HTTP Request from Client[2019-01-21 13:47:27]: method: GET url: /wd/hub/session/7a2aa959-5aa3-4bf2-9066-285c9910fb1b/contexts, jsonBody: {}
ios_webkit_debug_proxy path: /usr/local/bin/ios_webkit_debug_proxy
remote-debugger.js:47:18 [master] pid:8508 Device: SIMULATOR does not exist.
remote-debugger.js:65:12 [master] pid:8508 Getting pages from url: http://localhost:9221/json
macaca-ios.js:449:12 [master] pid:8508 Cannot find any Webview
responseHandler.js:49:14 [master] pid:8508 Send HTTP Respone to Client[2019-01-21 13:47:28]: {"sessionId":"7a2aa959-5aa3-4bf2-9066-285c9910fb1b","status":0,"value":"["NATIVE_APP"]"}

单独试了下 ios_webkit_debug_proxy,获取到的 http://localhost:9221/json 为空(https://github.com/google/ios-webkit-debug-proxy#can-not-see-simulator 已确保这几项都按文档操作了)

看到 IWDP 也有类似的 issue google/ios-webkit-debug-proxy#250

@macaca-bot
Copy link

This is the translated issue comment: @louiseyang


+1

The logs when getting contexts on the webview page are as follows:

responseHandler.js:49:14 [master] pid:8508 Send HTTP Respone to Client[2019-01-21 13:45:16]: {"sessionId":"7a2aa959-5aa3-4bf2-9066-285c9910fb1b", "status":0,"value":"{"platformName":"iOS","deviceName":"UITest-simulator","bundleId":"com.xxxx. Xxxx"}"}
responseHandler.js:11:12 [master] pid:8508 Recieve HTTP Request from Client[2019-01-21 13:47:27]: method: GET url: /wd/hub/session/7a2aa959-5aa3-4bf2 -9066-285c9910fb1b/contexts, jsonBody: {}
Ios_webkit_debug_proxy path: /usr/local/bin/ios_webkit_debug_proxy
remote-debugger.js:47:18 [master] pid:8508 Device: SIMULATOR does not exist.
remote-debugger.js:65:12 [master] pid:8508 Getting pages from url: http://localhost:9221/json
macaca-ios.js:449:12 [master] pid:8508 Cannot find any Webview
responseHandler.js:49:14 [master] pid:8508 Send HTTP Respone to Client[2019-01-21 13:47:28]: {"sessionId":"7a2aa959-5aa3-4bf2-9066-285c9910fb1b", "status": 0, "value": "["NATIVE_APP"]"}

I tried ios_webkit_debug_proxy separately and got http://localhost:9221/json empty (https://github.com/google/ios-webkit-debug-proxy#can-not-see-simulator Items are manipulated by document)

I see a similar issue with IWDP google/ios-webkit-debug-proxy#250

@xudafeng
Copy link
Member

xudafeng commented Apr 8, 2020

@macaca-bot
Copy link

This is the translated issue comment: @xudafeng


Such as a recent update
https://github.com/macacajs/node-ios-webkit-debug-proxy/pull/5/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants