Using watir-webdriver with Selenium I have element selectors with duplicate key warnings like
browser.div(class: 'one-possible-class', class: 'another-possible-class')
This works perfectly to resolve to elements that match either one or both of the given classes. The problem is that newer versions of Ruby (2.2 and up) throw warnings like this when different values are passed in using the same key.
warning: duplicated key at line 16 ignored: :class
So I tried using a regex
browser.div(class: /one-possible-class|another-possible-class/)
However, this did not work the same.