wallaby icon indicating copy to clipboard operation
wallaby copied to clipboard

xpath selectors need to use exact text for label fields.

Open keathley opened this issue 8 years ago • 4 comments

This is based on #257. Currently our xpath selectors for label text use contains(#{actual_text}). This can lead to "Multiple Element Errors" if 2 different fields have similar label texts. I think it would be good to match against the exact label text for an element instead of using contains(). This change would require users to use a fully qualified label text but, anecdotally, thats all I've ever seen anyone do in practice anyway.

keathley avatar Sep 18 '17 13:09 keathley

@keathley what about this issue? I'm facing exactly the issue as @jeffdeville in my application (Password and Password confirmation) and I'm looking for a solution.

zedtux avatar Dec 12 '17 13:12 zedtux

For now you should be able to use the id of the element like text_field("password") and text_field("password_confirmation").

keathley avatar Dec 12 '17 13:12 keathley

Thank you @keathley it is working 👍 but still do you have an idea when this could be addressed?

zedtux avatar Dec 12 '17 14:12 zedtux

I'll try to prioritize this fix.

keathley avatar Dec 12 '17 14:12 keathley