Created
August 31, 2016 19:27
-
-
Save aaltat/fb5e4de73dad82e09734460c80546e53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from robot.libraries.BuiltIn import BuiltIn | |
def check_text(text): | |
s2l = BuiltIn().get_library_instance('Selenium2Library') | |
driver = s2l._current_browser() | |
for element in driver.find_elements_by_xpath('//*'): | |
if text in element.text: | |
return | |
raise ValueError('Text {} not from page'.format(text)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment