Exactness

Learning Exactness

Exactness

 

Let’s start and understand Exactness. But before we understand Exactness, let’s have a look at Capybara.
It provides developers to simulate a user on a web page as well as make assertions based on the content and environment of the page. It also offers an API to interact with the web page.

Capybara.exact and the exact option work together with the is expression inside the XPath gem. When exact is true, all are expressions match exactly when it is false, they allow substring matches. Many of the selectors built into Capybara use the is expression. This way you can specify whether you want to allow substring matches or not. Capybara.exact is false by default.

 

For example:

click_link(“Password”) # also matches “Password confirmation”

Capybara.exact = true

click_link(“Password”) # does not match “Password confirmation”

click_link(“Password”, exact: false) # can be overridden

Looking at the above example, you can easily get an overview of what exactness is in matching. Nonetheless,
exact  — Control whether is expressions in the given XPath match exactly or partially. Defaults to exact.

More importantly,  if you want to understand and have a clear view of the topic, visit the link mentioned below.

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

DSL Summary
Understanding Strategy

Get industry recognized certification – Contact us

keyboard_arrow_up