Clear method is not clearing all characters in textbox for XCUITest element

I tried below code to clear and set the value into text box.

clear method executing as below:
If the text box contains any data, cursor is populating in the middle of the text and clearing only left side text, but not the right side text.

setValue method executing as below:
Even I use setValue instead of sendKeys the data is typing and appending with existing text in the textbox instead of setting(clear & enter the text)

IOSElement element = (IOSElement)driver.findElement(resolvedLocator);

Below is my Environment:
Framework: XCUITest
Xcode: 8.3.3
Appium : v1.7.2-beta2
iPad iOS version: 10.3.3 api version: 5.0.4

Ramesh Sriram

@ramesh_sriram did you find any workaround for this issue, kindly share if any.

I found the github issue without any solution.

Maybe you can try different things as a workaround:

  1. Get text value from the field.
  2. Clear textField until all characters of that String are deleted.


  1. Get location and size of the textField and press on the most right side of the field (to select a text at the very end).
  2. Call clear() or send keys to press delete button as long as it is empty.


  1. If your placeHolder of the textField is known has no placeHolder, call clear() function until that placeHolder is in the field or field is empty. (this one is similar to first solution).