javascript - Is it wrong to put ID's on DOM elements for automation because it would turn their CSS classes into singletons? -
i'm wondering correct way go automation (like selenium) is. told shouldn't put id's on elements, because can lead js errors (if duplicate id's exists) , can cause elements css classes become singletons. agree this, not having ids can make automation pain in rear.
thoughts?
you got pretty bad advice.
the "id" , "class" namespaces distinct. give page elements (unique) "id" values when need find them efficiently , reliably.
(what mean "automation", way, not entirely clear.)
Comments
Post a Comment