Hi I am using selenium to automate test on web pages. I am using selenium 2 and python and would like to have answers in this framework only. SO how do I check whether some text is present or not? I have tried asset equals but it is not working?
You can use
driver.page_source and a simple regular expression to check if the text exists:
import re src = driver.page_source text_found = re.search(r'text_to_search', src) self.assertNotEqual(text_found, None)