# Clear() is not clearing the prepopulated text box in ios

**URL:** <https://discuss.appium.io/t/clear-is-not-clearing-the-prepopulated-text-box-in-ios/7325>\
**Category:** Issues/Bugs\
**Created:** [November 30, 2015, 10:38pm UTC](https://discuss.appium.io/t/clear-is-not-clearing-the-prepopulated-text-box-in-ios/7325 "2015-11-30T22:38:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AppiumUser1](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/2bfe46/32.png) [@AppiumUser1](https://discuss.appium.io/u/AppiumUser1)\
**Post date:** [November 30, 2015, 10:38pm UTC](https://discuss.appium.io/t/clear-is-not-clearing-the-prepopulated-text-box-in-ios/7325/1 "2015-11-30T22:38:40Z")

</div>

We have been stuck on this for few days now. Appreciate your help.

WebElement element = driver.findElement(…);  
element.clear();  
element.sendKeys(“text to send”);

This is not clearing the existing text in the text box and clicking anywhere in middle or end of the existing text and typing the keys we are sending in. I am seeing this only on ios and not on Android.

Also tried sending CONTROL+“a” and DELETE keys before sending the text. That didnt work as well. We are using appium javaclient 3.0.

Thanks!

---

<div class="post-metadata">

**Author:** ![hemche](https://discuss.appium.io/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@hemche](https://discuss.appium.io/u/hemche)\
**Post date:** [December 1, 2015, 6:29am UTC](https://discuss.appium.io/t/clear-is-not-clearing-the-prepopulated-text-box-in-ios/7325/2 "2015-12-01T06:29:10Z")

</div>

Can you try using setValue() method which will by default clear any pre existing text?  
Disclaimer- This is just a workaround
