Repository navigation
fix(webdriver): handle HTTP error responses and alert text in MobileErrorHandler - #1366
Open
hoanle0126 wants to merge 1 commit into
Open
hoanle0126 wants to merge 1 commit into
hoanle0126 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change list
Fix three error-handling gaps in
MobileErrorHandler.check_response:WebDriverException(or the mapped subclass) whenever a response carries a non-zero error status (such as HTTP 401/502 plain-text or HTML proxy responses, flat JSON error objects without an outer value wrapper, or legacy JSONWP numeric status codes) instead of returning silently. Normal HTTP 200 responses and status 0 payloads remain unaffected.data.text(with fallback to string data oralert.text) when raisingUnexpectedAlertPresentException, instead of passing the raw data dict asalert_text.stackTraceframes and propagate screen captures when present in error payloads.Added unit tests in
test/unit/webdriver/errorhandler_test.pycovering W3C, JSONWP, HTTP proxy/auth errors, unexpected alert text extraction, context exceptions, and mocked driver HTTP responses.Types of changes