I found in another forum that the contains_text method has been deprecated in watir webdriver. I will be darned if I can find documentation showing precisely what methods webdriver supports. You might think http://watirwebdriver.com/ would have that. But, hmmm, no.
Asked
Active
Viewed 1,058 times
0
-
1Ummm yes. go to the watirwebdriver.com site, click LINKS in the menu banner, choose API docs. There you go, all the objects and methods it supports. – Chuck van der Linden Apr 05 '13 at 01:56
1 Answers
5
The API docs are a good starting place to look for supported methods - http://rubydoc.info/gems/watir-webdriver/frames.
For contains_text
, you should just get the text using the text
method and then use Ruby's string comparison methods.
You could do one of the following:
browser.text.include?(str)
browser.text =~ /regexp/

Justin Ko
- 46,526
- 5
- 91
- 101