Skip to content

Commit 55781cd

Browse files
committed
Merge branch 'doc-xpath' into documentation-release
2 parents 997ca60 + 04c5eb4 commit 55781cd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Selenium2Library/keywords/_element.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)