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

fix: Only wait for Console.enable RPC response if page load finishes #360

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

mykola-mokhnach
Copy link
Contributor

No description provided.

@KazuCocoa
Copy link
Member

hm, with this PR, no longer error occurred with the Console.enable and the following commands did not function. (no safari page load occurred on the GUI, no response for driver.title etc)

[HTTP] --> POST /session/294e0880-a446-4125-a2ab-b3c56660ee78/url
[HTTP] {"url":"https://rakuten.co.jp"}
[debug] [XCUITestDriver@a2a6 (294e0880)] Calling AppiumDriver.setUrl() with args: ["https://rakuten.co.jp","294e0880-a446-4125-a2ab-b3c56660ee78"]
[debug] [XCUITestDriver@a2a6 (294e0880)] Executing command 'setUrl'
[debug] [XCUITestDriver@a2a6 (294e0880)] Attempting to set url 'https://rakuten.co.jp'
[debug] [RemoteDebugger] Navigating to new URL: 'https://rakuten.co.jp'
[debug] [RemoteDebugger] Sending '_rpc_forwardSocketData:' message to app 'PID:10456', page '1', target 'page-119' (id: 90): 'Page.navigate'
[debug] [RemoteDebugger] Received data response from send (id: 90): '{}'
[debug] [RemoteDebugger] Sending to Web Inspector took 512ms
[debug] [RemoteDebugger] Received page change notice for app 'PID:10456' but the listing has not changed. Ignoring.
[debug] [RemoteDebugger] The page https://rakuten.co.jp is ready in 4761ms
[debug] [RemoteDebugger] Sending '_rpc_forwardSocketData:' message to app 'PID:10456', page '1', target 'page-119' (id: 92): 'Console.enable'
[debug] [RemoteDebugger] Received data response from send (id: 92): '{}'
[debug] [RemoteDebugger] Sending to Web Inspector took 216ms
[debug] [XCUITestDriver@a2a6 (294e0880)] Responding to client with driver.setUrl() result: null
[HTTP] <-- POST /session/294e0880-a446-4125-a2ab-b3c56660ee78/url 200 4981 ms - 14
[HTTP]
[HTTP] --> POST /session/294e0880-a446-4125-a2ab-b3c56660ee78/url
[HTTP] {"url":"https://rakuten.co.jp"}
[debug] [XCUITestDriver@a2a6 (294e0880)] Calling AppiumDriver.setUrl() with args: ["https://rakuten.co.jp","294e0880-a446-4125-a2ab-b3c56660ee78"]
[debug] [XCUITestDriver@a2a6 (294e0880)] Executing command 'setUrl'
[debug] [XCUITestDriver@a2a6 (294e0880)] Attempting to set url 'https://rakuten.co.jp'
[debug] [RemoteDebugger] Navigating to new URL: 'https://rakuten.co.jp'
[debug] [RemoteDebugger] Sending '_rpc_forwardSocketData:' message to app 'PID:10456', page '1', target 'page-119' (id: 94): 'Page.navigate'
[debug] [RemoteDebugger] Received data response from send (id: 94): '{}'
[debug] [RemoteDebugger] Sending to Web Inspector took 921ms
[RemoteDebugger] Timed out after 6000ms of waiting for the https://rakuten.co.jp page readiness. Continuing anyway
[debug] [RemoteDebugger] Sending '_rpc_forwardSocketData:' message to app 'PID:10456', page '1', target 'page-119' (id: 96): 'Console.enable'

# no response from here

[debug] [RemoteDebugger] Sending to Web Inspector took 4ms
[debug] [XCUITestDriver@a2a6 (294e0880)] Responding to client with driver.setUrl() result: null
[HTTP] <-- POST /session/294e0880-a446-4125-a2ab-b3c56660ee78/url 200 6009 ms - 14
[HTTP]
[HTTP] --> POST /session/294e0880-a446-4125-a2ab-b3c56660ee78/url
[HTTP] {"url":"https://rakuten.co.jp"}
[debug] [XCUITestDriver@a2a6 (294e0880)] Calling AppiumDriver.setUrl() with args: ["https://rakuten.co.jp","294e0880-a446-4125-a2ab-b3c56660ee78"]
[debug] [XCUITestDriver@a2a6 (294e0880)] Executing command 'setUrl'
[debug] [XCUITestDriver@a2a6 (294e0880)] Attempting to set url 'https://rakuten.co.jp'
[debug] [RemoteDebugger] Navigating to new URL: 'https://rakuten.co.jp'
[debug] [RemoteDebugger] Sending '_rpc_forwardSocketData:' message to app 'PID:10456', page '1', target 'page-119' (id: 98): 'Page.navigate'
[RemoteDebugger] Timed out after 6000ms of waiting for the https://rakuten.co.jp page readiness. Continuing anyway
[debug] [RemoteDebugger] Sending '_rpc_forwardSocketData:' message to app 'PID:10456', page '1', target 'page-119' (id: 100): 'Console.enable'
[debug] [RemoteDebugger] Sending to Web Inspector took 6ms
[debug] [XCUITestDriver@a2a6 (294e0880)] Responding to client with driver.setUrl() result: null
[HTTP] <-- POST /session/294e0880-a446-4125-a2ab-b3c56660ee78/url 200 6011 ms - 14

@KazuCocoa
Copy link
Member

Just a note:
it looks like Safari browser's GUI blinked when this behavior occurred. I guess Safari process itself got something like refreshed, restarted internally etc...?

@mykola-mokhnach
Copy link
Contributor Author

I would say the above behaviour is ok. It is anyway better in comparison to complete blocking.
We may also consider reporting an issue to Apple about that

@mykola-mokhnach mykola-mokhnach merged commit 7b9a107 into appium:master Feb 14, 2024
6 of 7 checks passed
@mykola-mokhnach mykola-mokhnach deleted the not_loaded branch February 14, 2024 21:10
github-actions bot pushed a commit that referenced this pull request Feb 14, 2024
## [11.0.2](v11.0.1...v11.0.2) (2024-02-14)

### Bug Fixes

* Only wait for Console.enable RPC response if page load finishes ([#360](#360)) ([7b9a107](7b9a107))
Copy link

🎉 This PR is included in version 11.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants