Test Project Automation tests are failing inconsistently due to xpath element locators change like the div numbers

TestProject Automation tests are failing inconsistently due to xpath element locators change like the div numbers,etc…
Is there a way we can find elements with labels or ids?

press shift key twice and then click on attributes.

I find that using a tool like Ranorex Selocity helps me better id my elements. I normally use xpath for my elements (I mostly test in a salesforce app) and it helps me define an element that won’t change unexpectedly.