https://cypress.io logo
If the project is new, you can go with Attribute a...
# best-practices
a
If the project is new, you can go with Attribute as its easy to maintain and also create a custom command where you pass the attribute value and set it. But if its existing project which is fairly large (Which is painful unless someone has coded keeping tests creation in mind) i havent seen the attributes written well, in such case we rely on IDs