macacajs / macacajs/macaca-ios
Cannot get the expected current_url & title after switch multiple webviews on iOS
@Jodeee is already working on this.
Since Feb 13, 2022.
- Dominant language
- JavaScript
- Stars
- 53
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
**When I try to switch multiple webviews and get the self.driver.title, OR self.driver.current_url, it always got the latest view's info.**
**http://localhost:9222/json**
[{
"devtoolsFrontendUrl": "/devtools/devtools.html?ws=localhost:9222/devtools/page/1",
"faviconUrl": "",
"thumbnailUrl": "/thumb/",
"title": "JSContext",
"url": "",
"webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/1",
"appId": "PID:11418"
},{
"devtoolsFrontendUrl": "/devtools/devtools.html?ws=localhost:9222/devtools/page/2",
"faviconUrl": "",
"thumbnailUrl": "/thumb/https://www.XXX.com/AAA",
"title": "AAA",
"url": "/https://www.XXX.com/AAA",
"webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/2",
"appId": "PID:11420"
},{
"devtoolsFrontendUrl": "",
"faviconUrl": "",
"thumbnailUrl": "/thumb/https://www.XXX.com/BBB",
"title": "BBB",
"url": "/https://www.XXX.com/BBB",
"webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/3",
"appId": "PID:11424"
},{
"devtoolsFrontendUrl": "/devtools/devtools.html?ws=localhost:9222/devtools/page/4",
"faviconUrl": "",
"thumbnailUrl": "/thumb/https://www.XXX.com/CCC",
"title": "CCC",
"url": "/https://www.XXX.com/CCC",
"webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/4",
"appId": "PID:11421"
},{
"devtoolsFrontendUrl": "/devtools/devtools.html?ws=localhost:9222/devtools/page/7",
"faviconUrl": "",
"thumbnailUrl": "/thumb/https://www.XXX.com/DDD",
"title": "DDD",
"url": "https://www.XXX.com/DDD"",
"webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/7",
"appId": "PID:11422"
},{
"devtoolsFrontendUrl": "/devtools/devtools.html?ws=localhost:9222/devtools/page/10",
"faviconUrl": "",
"thumbnailUrl": "/thumb/https://www.XXX.com/EEE",
"title": "EEE",
"url": "https://www.XXX.com/EEE",
"webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/10",
"appId": "PID:11423"
},{
"devtoolsFrontendUrl": "/devtools/devtools.html?ws=localhost:9222/devtools/page/13",
"faviconUrl": "",
"thumbnailUrl": "/thumb/about:blank",
"title": "",
"url": "about:blank",
"webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/13",
"appId": "PID:11444"
}]
**macaca server log**
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:29]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":"[\"NATIVE_APP\",\"WEBVIEW_2\",\"WEBVIEW_3\",\"WEBVIEW_4\",\"WEBVIEW_7\",\"WEBVIEW_10\",\"WEBVIEW_13\"]"}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:29]: method: POST url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/context, jsonBody: {"name":"WEBVIEW_10"}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> client.js:100:14 [master] pid:25470 Disconnecting from Remote debugger
>> client.js:36:16 [master] pid:25470 Remote debugger websocket disconnected with url: ws://localhost:9222/devtools/page/13
>> client.js:31:16 [master] pid:25470 Remote debugger connected to websocket url: ws://localhost:9222/devtools/page/10
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:29]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":null}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:31]: method: GET url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/url, jsonBody: {}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:31]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":"\"about:blank\""}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:33]: method: GET url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/contexts, jsonBody: {}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:33]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":"[\"NATIVE_APP\",\"WEBVIEW_2\",\"WEBVIEW_3\",\"WEBVIEW_4\",\"WEBVIEW_7\",\"WEBVIEW_10\",\"WEBVIEW_13\"]"}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:33]: method: POST url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/context, jsonBody: {"name":"WEBVIEW_7"}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> client.js:100:14 [master] pid:25470 Disconnecting from Remote debugger
>> client.js:36:16 [master] pid:25470 Remote debugger websocket disconnected with url: ws://localhost:9222/devtools/page/10
>> client.js:31:16 [master] pid:25470 Remote debugger connected to websocket url: ws://localhost:9222/devtools/page/7
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:33]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":null}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:35]: method: GET url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/url, jsonBody: {}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:35]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":"\"about:blank\""}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:37]: method: GET url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/contexts, jsonBody: {}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:37]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":"[\"NATIVE_APP\",\"WEBVIEW_2\",\"WEBVIEW_3\",\"WEBVIEW_4\",\"WEBVIEW_7\",\"WEBVIEW_10\",\"WEBVIEW_13\"]"}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:37]: method: POST url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/context, jsonBody: {"name":"WEBVIEW_4"}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> client.js:100:14 [master] pid:25470 Disconnecting from Remote debugger
>> client.js:36:16 [master] pid:25470 Remote debugger websocket disconnected with url: ws://localhost:9222/devtools/page/7
>> client.js:31:16 [master] pid:25470 Remote debugger connected to websocket url: ws://localhost:9222/devtools/page/4
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:37]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":null}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:39]: method: GET url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/url, jsonBody: {}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:39]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":"\"about:blank\""}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:41]: method: GET url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/contexts, jsonBody: {}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:41]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":"[\"NATIVE_APP\",\"WEBVIEW_2\",\"WEBVIEW_3\",\"WEBVIEW_4\",\"WEBVIEW_7\",\"WEBVIEW_10\",\"WEBVIEW_13\"]"}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:41]: method: POST url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/context, jsonBody: {"name":"WEBVIEW_3"}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> client.js:100:14 [master] pid:25470 Disconnecting from Remote debugger
>> client.js:36:16 [master] pid:25470 Remote debugger websocket disconnected with url: ws://localhost:9222/devtools/page/4
>> client.js:31:16 [master] pid:25470 Remote debugger connected to websocket url: ws://localhost:9222/devtools/page/3
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:41]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":null}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:43]: method: GET url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/url, jsonBody: {}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:43]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":"\"about:blank\""}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:45]: method: GET url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/contexts, jsonBody: {}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:45]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":"[\"NATIVE_APP\",\"WEBVIEW_2\",\"WEBVIEW_3\",\"WEBVIEW_4\",\"WEBVIEW_7\",\"WEBVIEW_10\",\"WEBVIEW_13\"]"}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:45]: method: POST url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/context, jsonBody: {"name":"WEBVIEW_2"}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> client.js:100:14 [master] pid:25470 Disconnecting from Remote debugger
>> client.js:36:16 [master] pid:25470 Remote debugger websocket disconnected with url: ws://localhost:9222/devtools/page/3
>> client.js:31:16 [master] pid:25470 Remote debugger connected to websocket url: ws://localhost:9222/devtools/page/2
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:45]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":null}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:47]: method: GET url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc/url, jsonBody: {}
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> remote-debugger.js:65:12 [master] pid:25470 Getting pages from url: http://localhost:9222/json
>> responseHandler.js:49:14 [master] pid:25470 Send HTTP Respone to Client[2019-05-17 14:22:47]: {"sessionId":"17d912bf-bd1c-4162-992a-264c91d594dc","status":0,"value":"\"about:blank\""}
>> responseHandler.js:11:12 [master] pid:25470 Recieve HTTP Request from Client[2019-05-17 14:22:47]: method: DELETE url: /wd/hub/session/17d912bf-bd1c-4162-992a-264c91d594dc, jsonBody: {}
>> macaca-ios.js:381:10 [master] pid:25470 Stoping iOS driver...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.