Hi Justin Thanks for the detailed explanation.
But cant we use collections here. Instead of declaring links as links(:product_names) { div(class: "price-and-quick-add-button-wrapper"). links(class: "name-link") } isnt links(:product_name, :class => 'name-link') better? And then use product_names_elements[0] and product_name_elemets[1] to access links? On Sunday, 24 March 2019 17:15:53 UTC+11, NaviHan wrote: > > I have seen in my project using css to identify elements using PageObject. > I always use attributes like id, class and name to identify elements. > > Which is the better way and why? > -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.