Repository navigation
fix(webdriver): handle HTTP error responses and alert text in MobileErrorHandler - #1366
hoanle0126 wants to merge 2 commits into
Conversation
0da2609 to
8933e90
Compare
|
I guess this PR has been changed since the original one. I added #1367 to simplify this appium client's behavior. Have you seen any necessary situation with this fix for w3c supported Appium versions? |
|
@KazuCocoa Yes, this PR was rebased onto #1367 (
Re-verified |
|
Could you clarify whether you've actually encountered these issues in a real environment using a W3C-compliant Appium version? I understand that these issues could theoretically occur, but I'd like to know whether they've been observed in practice. |
|
@KazuCocoa To be transparent, I have not encountered either case against a live W3C-compliant Appium server in practice. I noticed them while reading In practice, only non-W3C HTTP If you'd prefer keeping |
Change list
Build on the Selenium delegation in
MobileErrorHandler.check_responseto handle non-W3C HTTP failures, flat error payloads, and non-dict alert data without crashing or failing silently:WebDriverException(orUnknownMethodExceptionfor HTTP 405) when check_response receives an HTTP status >= 400 with non-JSON/HTML proxy bodies, JSON arrays/strings, empty value objects, or scalar string value payloads.datafields (wrapping string data in a text dict and omitting other non-dict values) before callingsuper().check_responsesoUnexpectedAlertPresentExceptionpreserves stringalert_textwithout raisingAttributeError.Updated unit tests in
test/unit/webdriver/errorhandler_test.pycovering HTTP error status codes, flat error objects, string and non-dict alert payloads, context exceptions, and Selenium W3C error delegation.Types of changes