This is not working for us. We also tried using @browser.text_field(:name,“vareeier”).value.matches(/[0-9]{9}/) @browser.text_field(:name,“vareeier”).verify_contains(/[0-9]{9}/)
None of these work.
Define “work”. Have you take the step of creating a test regex that must
succeed, in order to eliminate syntax errors other than regex ones?
Help…
I can’t help you with any Watir syntax issues that may be present, but
the
regex would be better written as:
/^\d{9}$/
This assures that nine consecutive digits are all that is present in the
field. Your original regex only assured that nine consecutive digits
were
present somewhere in a field that could contain an arbitrary amount of
other data.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.