Permalink
Browse files

Merge pull request #127 from emanlove/add-get-text-support

Check for element found under 'Get Text' and 'Element Should Contain' keywords
  • Loading branch information...
2 parents c95d29c + 9fe2bd2 commit b8d7b77d401e512fc12a59363a80eba1c5b6382d @emanlove emanlove committed Oct 2, 2012
Showing with 3 additions and 1 deletion.
  1. +1 −1 src/Selenium2Library/keywords/_element.py
  2. +2 −0 test/acceptance/keywords/content_assertions.txt
View
2 src/Selenium2Library/keywords/_element.py
@@ -552,7 +552,7 @@ def _frame_contains(self, locator, text):
return found
def _get_text(self, locator):
- element = self._element_find(locator, True, False)
+ element = self._element_find(locator, True, True)
if element is not None:
return element.text
return None
View
2 test/acceptance/keywords/content_assertions.txt
@@ -81,6 +81,7 @@ Page Should Not Contain Element With Disabling Source Logging
Element Should Contain
Element Should Contain some_id This text is inside an identified element
Run Keyword And Expect Error Element 'some_id' should have contained text 'non existing text' but its text was 'This text is inside an identified element'. Element Should Contain some_id non existing text
+ Run Keyword And Expect Error ValueError: Element locator 'missing_id' did not match any elements. Element Should Contain missing_id This should report missing element.
Element Text Should Be
Element Text Should Be some_id This text is inside an identified element
@@ -89,6 +90,7 @@ Element Text Should Be
Get Text
${str} = Get Text some_id
Should Match ${str} This text is inside an identified element
+ Run Keyword And Expect Error ValueError: Element locator 'missing_id' did not match any elements. Get Text missing_id
Element Should Be Visible
[Setup] Go To Page "visibility.html"

0 comments on commit b8d7b77

Please sign in to comment.