0
votes

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.

1
Ummm 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

1 Answers

5
votes

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/