Timeline for Is element unique ID preferable to use as a Selenium locator than element text?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 17, 2020 at 9:40 | history | edited | CommunityBot |
Commonmark migration
|
|
Apr 6, 2018 at 18:00 | comment | added | MivaScott | Kinda curious what's up with all the down votes on answers... | |
Apr 6, 2018 at 14:22 | comment | added | Florent B. |
@Peter Masiar, don't you mean efficient instead of robust? In my experience, what makes an expression robust is the way you design it. For instance By.cssSelector("#mybutton") is as much robust as By.xpath("id('mybutton')") , just like By.cssSelector("#container > div:nth-child(1) > div:nth-child(3) > input") would be an poor choice for a CSS selector.
|
|
Apr 6, 2018 at 13:27 | comment | added | Peter M. - stands for Monica | Generated ID is not "flaky". Flaky means intermittently failing. I often use generated ID, if I can find some logic (like all items in a generated grid row have ID based on the same number, with specific prefix). XPath locator can break after small design change, CSS is more robust because it is used for styles (so changes has other visible consequences). | |
Apr 6, 2018 at 12:35 | comment | added | Alan Larimer | The first, second, and fourth bullets are all reasons that automated testing is valuable in highlighting not following best practices or the introduction of possible breaking changes. The third is is a tooling issue that indicates that a re-evaluation might be valuable. | |
Apr 6, 2018 at 9:59 | comment | added | Amias | these frameworks are going to cause a lot of accesibility issues with this approach | |
Apr 5, 2018 at 20:24 | comment | added | inmydelorean | Yes, changes are possible, no doubt. They are possible in both ways, either id or text. What if developers replace buttons with images with no text? Then IDs are going to be the right choice. How often do you expect to see a complete redesign of a released product? Probably, not often, moreover, that's a quite rare case. As you say it's all variable and I agree with you. That's why I was surprised when it was interpreted as a flaw in my test. | |
Apr 5, 2018 at 19:47 | history | answered | MivaScott | CC BY-SA 3.0 |