1

I am trying to delete a character in textField, using --keyboard_enter_char "Delete"-- and here is my code in step definition.

touch(query("textField")[0])        # touch the textField and bring up the keyboard, working
keyboard_enter_text("a")            # enter "a" into the textField, working
keyboard_enter_char "delete"        # I expect to see the "a" gone

So when keyboard_enter_char "delete" is executed

I got an error

typing character 'delete' is not yet supported when running with Instruments (RuntimeError) 

and script stops.

Could anyone tell me what am I doing wrong or how should I delete a char from textField? Thank you!

Aravin
  • 6,605
  • 5
  • 42
  • 58
Ke MA
  • 761
  • 12
  • 30

1 Answers1

1

As I mentioned in the Calabash iOS Forum post you made, the correct usage is:

keyboard_enter_char("Delete")

We have an open issue around touching the delete key.

Use UIAutomation JavaScript to touch keyboard Delete key #942

The :wait_after_char suggested by Aravin will, mostly likely, have no effect.

Please don't cross post.

jmoody
  • 2,480
  • 1
  • 16
  • 22
  • 1
    Don't cross post? That comment is directed at Ke MA. Not you. Regarding your suggestion, it is OK, but I don't think it will fix the problem for this user. Thank you for answering though. I really appreciate it. – jmoody Dec 17 '15 at 10:42