how to exactly match using :class selector in watir-webdriver
问题 Regarding the backwards-incompatible change of Watir 0.5.x Finding elements by :class now matches partial class attributes. How do I get the old behavior? I.e. to match exact class name. It is breaking my code, in one case: # expand all multiple records while $browser.div(:class => "expander").exists? $browser.div(:class => "expander").click end because once .click ed, the div 's class becomes "expander hasChildren" (and possibly other classes, depending on table row's color and content). Is