Ke MA
Ke MA

Reputation: 771

Calabash-cucumber ios: how to delete a char in textField

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!

Upvotes: 1

Views: 596

Answers (1)

jmoody
jmoody

Reputation: 2480

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.

Upvotes: 1

Related Questions