Cannot delete text in TextField

Hi, I’m trying to clear TextField to rename file. After taping rename button from previous page, the view looks like this:

I’ve tried 4 methods and none of them worked:

  1. sendKeys (+ clicking on element before sendking keys) - text isn’t deleted and caret is moved at the beggining of the text. Sometimes text is typed, starting from this position and sometimes it’s just taping “Rename” button.

  2. clear() is selecting file name without extenstion and like in method 1, name isn’t deleted.

  3. longpress + cut text - text is copied instead of cutting it.

  4. deleteing text with keyevent 67 - doesn’t work.

I’m using Appium v. 1.4.13 + java client v. 3.4.1

@jakubkopczyk Can you paste the UIHiearchy from the inspector here?

<?xml version="1.0" encoding="UTF-8"?> <hierarchy rotation="0"> <android.widget.FrameLayout index="0" text="" class="android.widget.FrameLayout" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1440,2560]" resource-id="" instance="0"> <android.widget.LinearLayout index="0" text="" class="android.widget.LinearLayout" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1440,2560]" resource-id="" instance="0"> <android.widget.FrameLayout index="0" text="" class="android.widget.FrameLayout" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,100][1440,2560]" resource-id="" instance="1"> <android.view.View index="0" text="" class="android.view.View" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,100][1440,2560]" resource-id="com.swisscom.internetbox:id/decor_content_parent" instance="0"> <android.widget.FrameLayout index="0" text="" class="android.widget.FrameLayout" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,100][1440,324]" resource-id="com.swisscom.internetbox:id/action_bar_container" instance="2"> <android.view.View index="0" text="" class="android.view.View" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,100][1440,324]" resource-id="com.swisscom.internetbox:id/action_bar" instance="1"> <android.widget.ImageButton index="0" text="" class="android.widget.ImageButton" package="com.swisscom.internetbox" content-desc="Navigate up" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,100][224,324]" resource-id="" instance="0" /> <android.widget.TextView index="1" text="Rename" class="android.widget.TextView" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[240,164][496,259]" resource-id="" instance="0" /> <android.support.v7.widget.LinearLayoutCompat index="2" text="" class="android.support.v7.widget.LinearLayoutCompat" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[1151,100][1440,324]" resource-id="" instance="0"> <android.widget.TextView index="0" text="Rename" class="android.widget.TextView" package="com.swisscom.internetbox" content-desc="Rename" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="true" password="false" selected="false" bounds="[1151,116][1440,308]" resource-id="com.swisscom.internetbox:id/item_rename" instance="1" /> </android.support.v7.widget.LinearLayoutCompat> </android.view.View> </android.widget.FrameLayout> <android.widget.FrameLayout index="1" text="" class="android.widget.FrameLayout" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,324][1440,2560]" resource-id="android:id/content" instance="3"> <android.widget.RelativeLayout index="0" text="" class="android.widget.RelativeLayout" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,324][1440,2560]" resource-id="" instance="0"> <android.widget.RelativeLayout index="0" text="" class="android.widget.RelativeLayout" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,524][1440,620]" resource-id="" instance="1"> <android.widget.ImageView index="0" text="" class="android.widget.ImageView" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[110,524][206,620]" resource-id="com.swisscom.internetbox:id/icon" instance="0" /> <android.widget.EditText index="1" text="IMG_20160430_094300435_0.png" class="android.widget.EditText" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="true" scrollable="false" long-clickable="true" password="false" selected="false" bounds="[246,524][1330,620]" resource-id="com.swisscom.internetbox:id/folder_name" instance="0" /> </android.widget.RelativeLayout> </android.widget.RelativeLayout> </android.widget.FrameLayout> </android.view.View> </android.widget.FrameLayout> </android.widget.LinearLayout> <android.view.View index="1" text="" class="android.view.View" package="com.swisscom.internetbox" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1440,100]" resource-id="android:id/statusBarBackground" instance="2" /> </android.widget.FrameLayout> </hierarchy>

@jakubkopczyk
Is this the locator you are using? android.widget.EditText through className?

Yes, but I’m finding it by id “folder_name”.

@jakubkopczyk Then, i suspect that the field is really in editable mode. Do you need to click on any other (Edit or Rename) button before this field become editable? I knows it is a dumb question, but i wanted to do this basic check.

No, field is always editable. After name change, I click on “Rename” button.

That’s great ! As you have tried the 4 options mentioned above. I have a 5th option here.
Can you do a long press and then click on the X button on the keyboard?

I’ve tried Your option. Name before file extension is deleted, but there are problems with typing new one. Caret is moved to the beggining and only dot is selected. Then, caret is one more time moved to the beggiging instead of providing new name.

I’ve used longpress + sending keyevent 67, then sendkeys with filename.