Identifying elements on a ReactJS webpage using Selenium, is their a better way? Identifying elements on a ReactJS webpage using Selenium, is their a better way? selenium selenium

Identifying elements on a ReactJS webpage using Selenium, is their a better way?


It's common practice to use a data-test attribute on your HTML elements to assist in browser-based testing;, whether it's static or rendered by a JS framework; I would recommend that you request that the developers include these attributes throughout the codebase in order to allow you to easily target the elements you want to test without worrying about class names or id attributes changing.