How to loop DOMxpath location?

#1
Hello,

I have a DOMxpath

//section[@id='content']/div[3]/ul[1]/li[1]/div[1]/a[1]/img[1]

//section[@id='content']/div[3]/ul[1]/li[1]/div[1]/a[1]/img[2]

//section[@id='content']/div[3]/ul[1]/li[1]/div[1]/a[1]/img[3]

till 18th image, how can i use variable to loop above xpath.

View attachment 1565874630654.png

Thanks,
sky
 
#2
Hi Sky,

Try using the variable with initial value as 1 and before loop ends increment it by 1 using variable operation.Say variable name is vImage then your DOMxPath would be :
//section[@id='content']/div[3]/ul[1]/li[1]/div[1]/a[1]/img[$vImage$]

Let me know how it goes.

Regards
Tarun
 
#3
Hi Sky,

Try using the variable with initial value as 1 and before loop ends increment it by 1 using variable operation.Say variable name is vImage then your DOMxPath would be :
//section[@id='content']/div[3]/ul[1]/li[1]/div[1]/a[1]/img[$vImage$]

Let me know how it goes.

Regards
Tarun

Hi Tarun

How can we perform this in A2019 as it does not support the variable operation? How will I increase the counter?

Thanks
 
Top