@@ -416,11 +416,11 @@ def press_key(self, locator, key):
416416 """Simulates user pressing key on element identified by `locator`.
417417
418418 `key` is either a single character, or a numerical ASCII code of the key
419- lead by '\\ '.
419+ lead by '\\ \\ '.
420420
421421 Examples:
422422 | Press Key | text_field | q |
423- | Press Key | login_button | \\ 13 | # ASCII code for enter key |
423+ | Press Key | login_button | \\ \\ 13 | # ASCII code for enter key |
424424 """
425425 if key .startswith ('\\ ' ) and len (key ) > 1 :
426426 key = self ._map_ascii_key_code_to_key (int (key [1 :]))
@@ -534,6 +534,13 @@ def page_should_not_contain_image(self, locator, message='', loglevel='INFO'):
534534 def get_matching_xpath_count (self , xpath ):
535535 """Returns number of elements matching `xpath`
536536
537+ One should not use the xpath= prefix for 'xpath'. XPath is assumed.
538+
539+ Correct:
540+ | count = | Get Matching Xpath Count | //div[@id='sales-pop']
541+ Incorrect:
542+ | count = | Get Matching Xpath Count | xpath=//div[@id='sales-pop']
543+
537544 If you wish to assert the number of matching elements, use
538545 `Xpath Should Match X Times`.
539546 """
@@ -543,6 +550,13 @@ def get_matching_xpath_count(self, xpath):
543550 def xpath_should_match_x_times (self , xpath , expected_xpath_count , message = '' , loglevel = 'INFO' ):
544551 """Verifies that the page contains the given number of elements located by the given `xpath`.
545552
553+ One should not use the xpath= prefix for 'xpath'. XPath is assumed.
554+
555+ Correct:
556+ | Xpath Should Match X Times | //div[@id='sales-pop'] | 1
557+ Incorrect:
558+ | Xpath Should Match X Times | xpath=//div[@id='sales-pop'] | 1
559+
546560 See `Page Should Contain Element` for explanation about `message` and
547561 `loglevel` arguments.
548562 """
0 commit comments