I want to print the content of a error message that is situated in a span and looks something like this:
<span>Es exisitiert bereits ein Account mit dieser E-Mail Adresse. Wenn Sie sich sicher sind, dass dies Ihre Adresse ist, dann klicken Sie <a href="https://link-removed.com">hier</a> um das Passwort und den Zugang zu Ihrem Account zu erhalten.</span>
In my step definition, I tried the following
print page.find('.error-msg span')
This, however, doesn't really work. After googling for an hour I couldn't find anything that worked, which may also be due to the fact that I am pretty much new to all of this.
I basically want to debug, so I want to see what the actual content is. It will also be helpful for future endeavours.
You can call text
against that.
puts page.find('.error-msg span').text
http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Element
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