Read more

Upgrading Capybara with deprecated Integer selectors

Emanuel
June 08, 2021Software engineer at makandra GmbH

Capybara added a deprecation warning in version 3.35.3 (version from 2019) that shows up if your selector is not of type String or Symbol.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

Example:

click_link(10) # bad
click_link("10") # good

You might encounter this error e.g. in a pagination step or similar where you want to click on numbers. To figure out where this deprecation warning comes from try to run the tests with a step output.

bundle exec parallel_cucumber --test-options "--format=pretty" feature

The deprecation message looks like following:

Locator Integer:2 for selector :link must be an instance of String or Symbol
Locator Integer:3 for selector :link must be an instance of String or Symbol
Posted by Emanuel to makandra dev (2021-06-08 08:39)