Understanding Matching
Let’s understand Matching. It is possible to customize how Capybara finds elements. At your disposal are two options, Capybara.exact and Capybara.match.
Since the launch of the new updated version of Capybara, there are several changes to how Capybara reacts in various situations. However, all the changes in the intend to minimize unexpected errors. Not to mention, Capybara also understands the maintenance of backwards compatibility. However, it change a few defaults. In the same vein, it also offers to override the behaviour through passing: disabled => true to any of these methods, which will find only disabled elements.
Moreover, Capybara is also very tolerant about it matches. However, that maybe not always what you want. So, for that end find,
as well as actions methods like click_link
and fill_in.
Further, accept a called :exact
that also works together with the is
the expression inside the XPath gem.
To sum up, this was just a overview so that you can have an idea about what matching is. Moreover, in the upcoming sections, you will easily understand the more features of matching in capybara.
Make your resume stand out and become a Certified Capybara Testing Professional. Try free practice tests here!
A great career is just a certification away. So, practice and validate your skills to become Certified Capybara Testing Professional