Is there a way to find an element by the text it contains?
Given:
<div>foobar</div>
browser.div(text: contains('foo')).present?
# => true
Yes! Just use a regular expression:
browser.div(text: /foo/).present?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With