Comment 2 for bug 844450

Revision history for this message
Leo Arias (elopio) wrote :

Hi Michal,

Good ids are important to make tests readable and easy to maintain. But the most important thing is that they are the only way to be sure that you are using the element you are supposed to. Many elements can match whatever xpath expression you use to locate things; and even if you make it specific enough to match only one element, other elements will be added to the page and they might make the test fail. Or even worst, the test can pass but will not be doing what you meant when you first programmed it. This happens on the u1 services page, for example, where two buttons without id can not be easily distinguishable, and we have to use an index that might change in the future. For me, that's a testability bug.
So, elements without ids make UI tests even more fragile than they already are. In my opinion, adding ids to elements should be a development rule, and not using them for css styling should also be one :)

Where do you have those tests you made? I bet we have duplicated a little of your work :(

pura vida.