macacajs / macacajs/XCTestWD

切换webview后,对控件进行点击或输入失败

Open
#181 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
236
Forks
62
PR merge metrics
No merged PRs in 30d

Description

切换webview后,对控件进行点击或输入失败,server报的日志如下:

proxy.js:85:20 [master] pid:1844 Got response with status 200: {"status":0,"value":"","sessionId":""}
session.js:120:14 [master] pid:1844 Send HTTP Respone to Client[2020-12-11 14:39:19]: {"status":0,"value":"","sessionId":""}
responseHandler.js:11:12 [master] pid:1844 Recieve HTTP Request from Client[2020-12-11 14:39:29]: method: GET url: /wd/hub/session/9db3be7a-9e40-432b-917d-e02cc3897d5d/contexts, jsonBody: {}
ios_webkit_debug_proxy path: /usr/local/bin/ios_webkit_debug_proxy
remote-debugger.js:99:14 [master] pid:1844 Fetching devices from http://localhost:9221/json
remote-debugger.js:118:14 [master] pid:1844 Configure port: 9222 for deviceId: 64a4f7c97d9433cbe1557515b1c82874e80374f0
remote-debugger.js:134:14 [master] pid:1844 Getting pages from url: http://localhost:9222/json
responseHandler.js:49:14 [master] pid:1844 Send HTTP Respone to Client[2020-12-11 14:39:31]: {"sessionId":"9db3be7a-9e40-432b-917d-e02cc3897d5d","status":0,"value":"["NATIVE_APP","WEBVIEW_1"]"}
responseHandler.js:11:12 [master] pid:1844 Recieve HTTP Request from Client[2020-12-11 14:39:31]: method: POST url: /wd/hub/session/9db3be7a-9e40-432b-917d-e02cc3897d5d/context, jsonBody: {"name":"WEBVIEW_1"}
remote-debugger.js:134:14 [master] pid:1844 Getting pages from url: http://localhost:9222/json
client.js:31:16 [master] pid:1844 Remote debugger connected to websocket url: ws://localhost:9222/devtools/page/1
responseHandler.js:49:14 [master] pid:1844 Send HTTP Respone to Client[2020-12-11 14:39:31]: {"sessionId":"9db3be7a-9e40-432b-917d-e02cc3897d5d","status":0,"value":null}
client.js:51:12 [master] pid:1844 Get result from websocket: {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"page-6","type":"page"}}}
responseHandler.js:11:12 [master] pid:1844 Recieve HTTP Request from Client[2020-12-11 14:39:31]: method: GET url: /wd/hub/session/9db3be7a-9e40-432b-917d-e02cc3897d5d/context, jsonBody: {}
remote-debugger.js:134:14 [master] pid:1844 Getting pages from url: http://localhost:9222/json
responseHandler.js:49:14 [master] pid:1844 Send HTTP Respone to Client[2020-12-11 14:39:31]: {"sessionId":"9db3be7a-9e40-432b-917d-e02cc3897d5d","status":0,"value":""WEBVIEW_1""}
responseHandler.js:11:12 [master] pid:1844 Recieve HTTP Request from Client[2020-12-11 14:39:31]: method: POST url: /wd/hub/session/9db3be7a-9e40-432b-917d-e02cc3897d5d/element, jsonBody: {"using":"id","value":"identifierId"}
remote-debugger.js:134:14 [master] pid:1844 Getting pages from url: http://localhost:9222/json
client.js:115:14 [master] pid:1844 Send command to websocket: {"method":"Runtime.evaluate","params":{"expression":"(function(){return function(){var l=this;function aa(a){return void 0!==a}function ba(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&aa(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}}\nfunction ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";i...
client.js:51:12 [master] pid:1844 Get result from websocket: {"error":{"code":-32601,"message":"'Runtime' domain was not found","data":[{"code":-32601,"message":"'Runtime' domain was not found"}]},"id":1}
client.js:115:14 [master] pid:1844 Send command to websocket: {"method":"Runtime.evaluate","params":{"expression":"(function(){return function(){var l=this;function aa(a){return void 0!==a}function ba(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&aa(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}}\nfunction ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";i...
client.js:51:12 [master] pid:1844 Get result from websocket: {"error":{"code":-32601,"message":"'Runtime' domain was not found","data":[{"code":-32601,"message":"'Runtime' domain was not found"}]},"id":2}
client.js:115:14 [master] pid:1844 Send command to websocket: {"method":"Runtime.evaluate","params":{"expression":"(function(){return function(){var l=this;function aa(a){return void 0!==a}function ba(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&aa(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}}\nfunction ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";i...
client.js:51:12 [master] pid:1844 Get result from websocket: {"error":{"code":-32601,"message":"'Runtime' domain was not found","data":[{"code":-32601,"message":"'Runtime' domain was not found"}]},"id":3}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the context-switching request in the logs, then inspect client.js and remote-debugger.js around the Runtime.evaluate websocket commands. Reproduce the WEBVIEW_1 switch and subsequent element lookup, and use the reported Runtime domain error to trace the failure. Done means clicking or typing after switching webviews works without those errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript, swift
Domain
mobile, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.