Please find the HTML :
<div id="086" data-activity-type="CompatCheck" class="Activity"></div>
Here only constant value is data-activity-type="CompatCheck"
and classname is same for all the other elements.
while trying to print id using data-activity-type
i.e. CompatCheck using xpath
Expected output:
086
Problem 2 : Observed that the only unique value is id, how can we fetch in this case.
Please Find the HTML :
<div id="0007" data-activity-type="CompatCheck" class="Activity"></div>
<div id="110007" data-activity-type="CompatCheck" class="Activity"</div>
While trying to use following code line :
findElement(By.xpath("//div[@data-activity-type='CompatCheck']")).getAttribute("id");
I'm getting only first id i.e; 0007
but I need always the second id="110007", can you please suggest to get the second id