Skip to content

Commit 837f224

Browse files
Merge pull request #4 from zephraph/press_key_#275
Fix documentation, small bugs
2 parents cdb3360 + 353b2df commit 837f224

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Selenium2Library/keywords/_element.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,14 @@ def press_key(self, locator, key):
480480
"""Simulates user pressing key on element identified by `locator`.
481481
482482
`key` is either a single character, a numerical ASCII code of the key lead by '\\\\',
483-
or a NAMED KEY as described at https://selenium.googlecode.com/git/docs/api/py/webdriver/selenium.webdriver.common.keys.html
483+
or a NAMED KEY as described in the [https://selenium.googlecode.com/git/docs/api/py/webdriver/selenium.webdriver.common.keys.html|Selenium docs].
484484
485485
Examples:
486486
| Press Key | text_field | q | # The letter 'q' |
487+
| Press Key | nav_console | ARROW_UP | # Named ARROW_UP key |
487488
| Press Key | login_button | \\\\13 | # ASCII code for Enter key |
488-
| Press Key | nav_console | ARROW_UP | # selenium.webdriver.common.keys ARROW_UP KEY |
489+
490+
It's recommended to use named keys over ascii escapes (.i.e ``ENTER`` over ``\\\\13``)
489491
490492
NAMED KEY value is new in Selenium2Library 1.7.3.
491493
"""
@@ -759,7 +761,6 @@ def _map_named_key_code_to_special_key(self, key_name):
759761
message = "Unknown key named '%s'." % (key_name)
760762
self._debug(message)
761763
raise ValueError(message)
762-
return Keys.NULL
763764

764765
def _parse_attribute_locator(self, attribute_locator):
765766
parts = attribute_locator.rpartition('@')

test/acceptance/keywords/textfields.robot

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
*** Setting ***
22
Test Setup Go To Page "forms/prefilled_email_form.html"
3-
Force Tags txtfields
43
Variables variables.py
54
Resource ../resource.robot
65

0 commit comments

Comments
 (0)