Appium appium 1.6.4 (iOS) 、xcode8.3、iPhone6 真机,启动 Safari 进行 wap 自动化测试,求助!

JasonChang · 2017年07月07日 · 最后由 渐次消逝 回复于 2017年08月03日 · 1371 次阅读

最近需要做 wap 端的 iOS 自动化测试,现在我可以启动 Safari,使用 driver.get('www.baidu.com') 方法启动百度,最后 appium 报错,iPhone 的 Safari 没有打开百度,打开的却是 appium.io 的网址;appium 的部分日志如下:
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[iOS] Could not find any webviews yet, refreshing/retrying
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[iOS] Could not find any webviews yet, refreshing/retrying
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[iOS] Could not find any webviews yet, refreshing/retrying
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[iOS] Could not find any webviews yet, refreshing/retrying
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[iOS] Could not find any webviews yet, refreshing/retrying
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[iOS] Could not find any webviews yet, refreshing/retrying
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[iOS] Could not find any webviews yet, refreshing/retrying
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[iOS] Could not find any webviews yet, refreshing/retrying
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[iOS] Could not find any webviews yet, refreshing/retrying
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[iOS] Could not find any webviews yet, refreshing/retrying
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: true (expected url: 'http://appium.io')
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible
[debug] [iOS] No web frames found.
[XCUITest] Error: Could not navigate to webview; there are none!
at XCUITestDriver.spinHandles$ (../../../lib/commands/context.js:511:13)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
Error: Could not navigate to webview; there are none!
at XCUITestDriver.spinHandles$ (../../../lib/commands/context.js:511:13)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[debug] [JSONWP Proxy] Proxying [DELETE /session/1a016856-c0cd-4d59-92fe-315b67bb570d] to [DELETE http://localhost:8100/session/12762F33-B6B3-4B20-A938-432611BF2F2D] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n\n },\n \"sessionId\" : \"578AC5DD-C3AE-4D81-8A93-9366ACE947DB\",\n \"status\" : 0\n}"
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down xcodebuild process (pid 2016)
[XCUITest] xcodebuild exited with code 'null' and signal 'SIGTERM'
[XCUITest] Shutting down iproxy process (pid 2012)
[debug] [XCUITest] iproxy exited with code 'null'
[debug] [XCUITest] Found WDA derived data folder: '/Users/hoperun/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy'
[XCUITest] Setting '755' permissions to '/Users/hoperun/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/Attachments' folder
[debug] [XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on.
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: Could not navigate to webview; there are none!
at XCUITestDriver.spinHandles$ (../../../lib/commands/context.js:511:13)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[HTTP] <-- POST /wd/hub/session 500 120078 ms - 183

有没有大神遇到过,求指教,小弟这厢有礼啦!

共收到 4 条回复 时间 点赞

解决了吗? share 一下🌹

  1. 贴下代码
  2. 前面加 http 前缀试一下
杜哲 回复

没有解决呢啊

试试另外开一个终端启动 ios_webkit_debug_proxy -c 测试手机的 uuid:27753 -d ,然后再启动 appium

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册