Skip to content

Commit 82fe95a

Browse files
committed
Merge pull request #72 from emanlove/add-get-text-support
Add get text support
2 parents 241fcc2 + ef04583 commit 82fe95a

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Release Notes
66
- Added iframe support by removing strict filtering for only <frame> elements.
77
[emanlove]
88

9+
- Added the 'get text' keyword to be backwards compatible with the original
10+
Selenium Library.
11+
[jouk0]
12+
913
1.0.1
1014
-----
1115
- Support for Robot Framework 2.7

src/Selenium2Library/keywords/_element.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,13 @@ def get_value(self, locator):
228228
See `introduction` for details about locating elements.
229229
"""
230230
return self._get_value(locator)
231+
232+
def get_text(self, locator):
233+
"""Returns the text value of element identified by `locator`.
234+
235+
See `introduction` for details about locating elements.
236+
"""
237+
return self._get_text(locator)
231238

232239
def get_vertical_position(self, locator):
233240
"""Returns vertical position of element identified by `locator`.

test/acceptance/keywords/content_assertions.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ Element Text Should Be
8686
Element Text Should Be some_id This text is inside an identified element
8787
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
8888

89+
Get Text
90+
${str} = Get Text some_id
91+
Should Match ${str} This text is inside an identified element
92+
8993
Element Should Be Visible
9094
[Setup] Go To Page "visibility.html"
9195
Element Should Be Visible i_am_visible

0 commit comments

Comments
 (0)