bug: Appium XCUITest crashes the iOS app on clearing the input XCUIElementTypeTextField #20088
Closed
3 tasks done
Labels
Needs Info
typically non-actionable; needs author to respond
Do I have the most recent component updates?
Is the component officially supported by the Appium team?
Is there an existing issue for this?
Current Behavior
Hi,
I have faced a strange issue today where Appium causes iOS app to crash if I send the
clear()
command on WebElement that is of type XCUIElementTypeTextField. The problem is not specific to any client binding but rather i can also reproduce this with Appium Inspector so I suspect problem lies in Appium server or XCUITest driver.on reaching the statement
textField.clear();
, it throws StaleElementReferenceException and closes the application:-For some unknown reasosn, I understand the StaleElementReferenceException but I dont understand why it is crashing the app also.
Appium Logs:-
Screenshot of Appium Inspector:
Failure message from Appium Inspector:
As a work around, I have now cleared the input field via alternative method by calling keyboard BACK_SPACE key multiple times instead:
textField.sendKeys(Keys.BACK_SPACE);
This works but it is just a hack around original issue.
Expected Behavior
Appium should clear the input field element successfully without throwing error and crashing the application.
Minimal Reproducible Example
Example code:-
You can also reproduce the issue with Appium Inspector itself without needing to write code. This issue happens only with this specific input field in app.
Environment
appium --version
): 2.4.1node --version
): v20.11.0npm
version (output ofnpm --version
): 10.2.4Link to Appium Logs
No response
Further Information
No response
The text was updated successfully, but these errors were encountered: