diff --git a/src/Selenium2Library/keywords/_element.py b/src/Selenium2Library/keywords/_element.py index ac5ae2e07..48bd34aca 100644 --- a/src/Selenium2Library/keywords/_element.py +++ b/src/Selenium2Library/keywords/_element.py @@ -485,10 +485,11 @@ def simulate(self, locator, event): def press_key(self, locator, key): """Simulates user pressing key on element identified by `locator`. - `key` is either a single character, or a numerical ASCII code of the key + `key` is either a single character, a string, or a numerical ASCII code of the key lead by '\\\\'. Examples: | Press Key | text_field | q | + | Press Key | text_field | abcde | | Press Key | login_button | \\\\13 | # ASCII code for enter key | """ if key.startswith('\\') and len(key) > 1: diff --git a/test/acceptance/keywords/textfields.robot b/test/acceptance/keywords/textfields.robot index e0ce3b667..e0ff2739a 100644 --- a/test/acceptance/keywords/textfields.robot +++ b/test/acceptance/keywords/textfields.robot @@ -30,10 +30,11 @@ Input Password Press Key [Setup] Go To Page "forms/login.html" Cannot Be Executed in IE - Input Text username_field James Bond - Press Key password_field f - Press Key password_field \\9 - Press Key login_button \\10 + Press Key username_field James Bon + Press Key username_field \\100 + Textfield Value Should Be username_field James Bond + Press Key password_field f + Press Key login_button \\10 Verify Location Is "forms/submit.html" Attempt Clear Element Text On Non-Editable Field