Hi @Balasamaran ,
You have to create the Loop to find the N number occurrence.
Please use the loop and find actions to achieve this.
Note : Once you have find the value, increase the counter variable then loop will continue until the value doesn’t match. Also, each findings you have to increase the start from the location value. otherwise will be shown the same value again and again.
I did face similar issue and fixed by following below steps.
First identify the html node which is repeating. In my case, I’m looking for the image.
//img (@src='images/health/critical.svg']
If there are 2 images on the page, you can iterate each image by using below in the domxpath.
(//img (@src='images/health/critical.svg'])g1] -->Will pick first image
(//img (@src='images/health/critical.svg'])s2] -->Will pick Second image.
I got the total count of images available by using the browser package run java script (below script) method and storing in integer variable.
document.evaluate (" / /img(@src='images/health/critical.svg']", document, null, |XPathResult. UNORDERED_ NODE_ SNAPSHOT_ TYPE, null). snapshotLength
I have used the integer variable for the loop counter and (//img (@src='images/health/critical.svg'])t$loopCounter] as the domX path for the identified element, able to click on each image in a loop.
I hope this will help you. Let us know if you have further doubts.
Thanks @sravan.aluvala and @Tamil Arasu10 . Your inputs helped. I was able to get the number of times an element appears in a page with a slight modification of your ideas. Thanks once again.