SystemicPlural
SystemicPlural

Reputation: 5789

How to give a textbox focus for keyPress and typeKeys

If I use typeKeys or keyPress with the target being a textbox, then nothing happens if the textbox does not have focus. How do I give focus to the textbox?

E.G. The following should delete a character from my_textbox, but it only works if I manually click on the textbox before running it.

<tr>
  <td>keyPress</td>
  <td>css=#my_textbox</td>
  <td>\8</td>
</tr>

Upvotes: 2

Views: 3932

Answers (2)

Rohit Ware
Rohit Ware

Reputation: 2002

1.focus | css=#my_textbox 2.keypress | css=#my_textbox | \8

try out this one

Upvotes: 1

bratkartoffel
bratkartoffel

Reputation: 1177

Try to add the command focus just before your keyPress command.

Upvotes: 3

Related Questions