diff --git a/src/Selenium2Library/__init__.py b/src/Selenium2Library/__init__.py index da5696fc1..3a481a883 100644 --- a/src/Selenium2Library/__init__.py +++ b/src/Selenium2Library/__init__.py @@ -33,7 +33,8 @@ class Selenium2Library( imported into your Robot test suite (see `importing` section), and the `Open Browser` keyword must be used to open a browser to the desired location. - **--- Note important change starting with Version 1.7.0 release ---** + + *--- Note important change starting with Version 1.7.0 release ---* = Locating or specifying elements = All keywords in Selenium2Library that need to find an element on the page @@ -42,14 +43,14 @@ class Selenium2Library( specifying different location strategies. `webelement` is a variable that holds a WebElement instance, which is a representation of the element. - Using 'locator' + *Using locators* --------------- By default, when a locator value is provided, it is matched against the key attributes of the particular element type. For example, `id` and `name` are key attributes to all elements, and locating elements is easy - using just the `id` as a `locator`. For example:: + using just the `id` as a `locator`. For example: - Click Element my_element + | Click Element my_element It is also possible to specify the approach Selenium2Library should take to find an element by specifying a lookup strategy with a locator @@ -76,14 +77,14 @@ class Selenium2Library( This can be fixed by changing the locator to: | Click Link default=page?a=b - Using 'webelement' + *Using webelements* ------------------ Starting with version 1.7 of the Selenium2Library, one can pass an argument that contains a WebElement instead of a string locator. To get a WebElement, use the new `Get WebElements` keyword. For example: - | ${elem} = | Get WebElements | id=my_element | - | Click Element | ${elem} | | + | ${elem} = | Get WebElement | id=my_element | + | Click Element | ${elem} | | Locating Tables, Table Rows, Columns, etc. ------------------------------------------ @@ -91,7 +92,7 @@ class Selenium2Library( By default, when a table locator value is provided, it will search for a table with the specified `id` attribute. For example: - Table Should Contain my_table text + | Table Should Contain my_table text More complex table lookup strategies are also supported: @@ -113,7 +114,7 @@ class Selenium2Library( to the WebDriver instance and `${criteria}` is the text of the locator (i.e. everything that comes after the = sign). To use this locator it must first be registered with `Add Location Strategy`. - Add Location Strategy custom Custom Locator Strategy + | Add Location Strategy custom Custom Locator Strategy The first argument of `Add Location Strategy` specifies the name of the lookup strategy (which must be unique). After registration of the lookup strategy, the usage is the same as other locators. See `Add Location Strategy` for more details.