Skip to content

Commit 910b14d

Browse files
committed
Merge pull request #264 from emanlove/documentation-release
Documentation updates and changes
2 parents 0c25caa + 424a454 commit 910b14d

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

BUILD.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ To run just the unit tests, run::
6666
python test/run_unit_tests.py
6767

6868

69+
Debugging Selenium2Library
70+
--------------------------
71+
72+
In the course of debugging the Selenium2Library one might need to set a
73+
breakpoint using `pdb`_. Since Robot Framework hijacks the console output
74+
one should use the folowing code to redirect output back to stdout for
75+
debugging purposes.
76+
77+
import pdb,sys; pdb.Pdb(stdout=sys.__stdout__).set_trace()
78+
79+
6980
Testing Third-Party Packages
7081
----------------------------
7182

@@ -276,6 +287,7 @@ are parsed by the reStructuredText parser. To build them, run::
276287
python doc/generate_readmes.py
277288

278289

290+
.. _pdb: http://docs.python.org/2/library/pdb.html
279291
.. _downloads section on GitHub: https://github.com/rtomac/robotframework-selenium2library/downloads
280292
.. _PyPI: http://pypi.python.org
281293
.. _.pypirc file: http://docs.python.org/distutils/packageindex.html#the-pypirc-file

src/Selenium2Library/keywords/_element.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ def press_key(self, locator, key):
480480
"""Simulates user pressing key on element identified by `locator`.
481481
482482
`key` is either a single character, or a numerical ASCII code of the key
483-
lead by '\\'. In test data, '\\' must be escaped, so use '\\\\'.
483+
lead by '\\\\'.
484484
485485
Examples:
486486
| Press Key | text_field | q |
@@ -598,6 +598,13 @@ def page_should_not_contain_image(self, locator, message='', loglevel='INFO'):
598598
def get_matching_xpath_count(self, xpath):
599599
"""Returns number of elements matching `xpath`
600600
601+
One should not use the xpath= prefix for 'xpath'. XPath is assumed.
602+
603+
Correct:
604+
| count = | Get Matching Xpath Count | //div[@id='sales-pop']
605+
Incorrect:
606+
| count = | Get Matching Xpath Count | xpath=//div[@id='sales-pop']
607+
601608
If you wish to assert the number of matching elements, use
602609
`Xpath Should Match X Times`.
603610
"""
@@ -607,6 +614,13 @@ def get_matching_xpath_count(self, xpath):
607614
def xpath_should_match_x_times(self, xpath, expected_xpath_count, message='', loglevel='INFO'):
608615
"""Verifies that the page contains the given number of elements located by the given `xpath`.
609616
617+
One should not use the xpath= prefix for 'xpath'. XPath is assumed.
618+
619+
Correct:
620+
| Xpath Should Match X Times | //div[@id='sales-pop'] | 1
621+
Incorrect:
622+
| Xpath Should Match X Times | xpath=//div[@id='sales-pop'] | 1
623+
610624
See `Page Should Contain Element` for explanation about `message` and
611625
`loglevel` arguments.
612626
"""

0 commit comments

Comments
 (0)