Verify Text Present on Page

Asked by Artem Ustinov

Hi,

Vhat is the preferred analogue in sst for Selenium's Verify Text Present?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
selenium-simple-test Edit question
Assignee:
No assignee Edit question
Solved by:
Corey Goldberg
Solved:
Last query:
Last reply:
Revision history for this message
Best Corey Goldberg (coreygoldberg) said :
#1

you can use `get_element(Text='foo')` to try locating any element by specified text attribute. It will throw an exception if it fails to locate it.

you calso assert text in get_page_source()

hope that helps.

-Corey

Revision history for this message
Artem Ustinov (ustinov) said :
#2

Thanks Corey Goldberg, that solved my question.

Revision history for this message
Corey Goldberg (coreygoldberg) said :
#3

note.. it is:
get_element(text='foo')
(no caps in kwarg)

Revision history for this message
Michael Foord (mfoord) said :
#4

There is also a text_regext filter on get_element, so you can do assert_element(tag='p', text_regex='foo')