I am trying to automate Salesforce lightning using Selenium, but getting issues with identifying elements. Reason, its having dynamic IDs , and other attributes are either very long , or they are not unique.
For eg , /a id="170:1968;a" class="textUnderline outputLookupLink slds-truncate forceOutputLookup" data-refid="recordId" data-recordid="0059E000001aOCSQA2" data-special-link="true" href="#/sObject/0059E000001aOCSQA2/view" target="_blank" rel="noreferrer" title="" data-aura-rendered-by="170:1968;a" data-aura-class="forceOutputLookup"/
<a id="170:1968;a" class="textUnderline outputLookupLink slds-truncate forceOutputLookup"
data-refid="recordId"
data-recordid="0059E000001aOCSQA2"
data-special-link="true"
href="#/sObject/0059E000001aOCSQA2/view"
target="_blank" rel="noreferrer"
title="" data-aura-rendered-by="170:1968;a" data-aura-class="forceOutputLookup"/>
In above code , ID is dynamic , Class is not unique, and all the Lookup elements are associated with it. Also the absolute path is not much trusted , and hence I am trying to find any concrete option to handle these elements. Any help will be highly appreciated.