Skip to content

Commit c34dae1

Browse files
committed
Merge pull request #495 from rtomac/press-key-hotfix
Update documentation, tests for Press Key
2 parents 4548536 + 1434637 commit c34dae1

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Selenium2Library/keywords/_element.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,11 @@ def simulate(self, locator, event):
485485

486486
def press_key(self, locator, key):
487487
"""Simulates user pressing key on element identified by `locator`.
488-
`key` is either a single character, or a numerical ASCII code of the key
488+
`key` is either a single character, a string, or a numerical ASCII code of the key
489489
lead by '\\\\'.
490490
Examples:
491491
| Press Key | text_field | q |
492+
| Press Key | text_field | abcde |
492493
| Press Key | login_button | \\\\13 | # ASCII code for enter key |
493494
"""
494495
if key.startswith('\\') and len(key) > 1:

test/acceptance/keywords/textfields.robot

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ Input Password
3030
Press Key
3131
[Setup] Go To Page "forms/login.html"
3232
Cannot Be Executed in IE
33-
Input Text username_field James Bond
34-
Press Key password_field f
35-
Press Key password_field \\9
36-
Press Key login_button \\10
33+
Press Key username_field James Bon
34+
Press Key username_field \\100
35+
Textfield Value Should Be username_field James Bond
36+
Press Key password_field f
37+
Press Key login_button \\10
3738
Verify Location Is "forms/submit.html"
3839

3940
Attempt Clear Element Text On Non-Editable Field

0 commit comments

Comments
 (0)