Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Release Notes
- Added iframe support by removing strict filtering for only <frame> elements.
[emanlove]

- Added the 'get text' keyword to be backwards compatible with the original
Selenium Library.
[jouk0]

1.0.1
-----
- Support for Robot Framework 2.7
Expand Down
7 changes: 7 additions & 0 deletions src/Selenium2Library/keywords/_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ def get_value(self, locator):
See `introduction` for details about locating elements.
"""
return self._get_value(locator)

def get_text(self, locator):
"""Returns the text value of element identified by `locator`.

See `introduction` for details about locating elements.
"""
return self._get_text(locator)

def get_vertical_position(self, locator):
"""Returns vertical position of element identified by `locator`.
Expand Down
4 changes: 4 additions & 0 deletions test/acceptance/keywords/content_assertions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ Element Text Should Be
Element Text Should Be some_id This text is inside an identified element
Run Keyword And Expect Error The text of element 'some_id' should have been 'inside' but in fact it was 'This text is inside an identified element'. Element Text Should Be some_id inside

Get Text
${str} = Get Text some_id
Should Match ${str} This text is inside an identified element

Element Should Be Visible
[Setup] Go To Page "visibility.html"
Element Should Be Visible i_am_visible
Expand Down