Loop through each row of a web table

Hi,

I have to double click on each row in a web table (which is a search result). I don’t know how to manage this issue as the the ID of each rows seems to be the ID of the record and not the Id of the row.

For example :
Xapth for the first row in the second column is //[@id=“ResultResearchGridView-record-353”]/tbody/tr/td[2]/div
Xpath for the second row in the second column is //
[@id=“ResultResearchGridView-record-354”]/tbody/tr/td[2]/div

So, Instead of having the ID of the row (1,2,…) in the Xpath, I have the record ID (353,354,…). Depending on the result, the Id of the row is different (whatever the number of result).

Link of the search tool : https://supervisedentities.apps.cssf.lu/index.html?language=fr&type=BNK#ResultResearch

Thanks,

Hi @loger
each row in the result table is separate table, so try using xpath //table[contains(@id,‘ResultResearchGridView-record’)][${counter}]
where ${counter} is the index pointing to the row you need

Thanls Ashapkina. It seems very easy but I don’t succed to retrieve Xapth //table[contains(@id,‘ResultResearchGridView-record’)][9]

I’m using the inspect function in Chrome but struggling to find this Xpath. The data displayed on my screen are not the same as per your printscreen. See attached printscreen.

@loger in this case the Xpath you copy from DevTools only works for 1 particular row. You need to make a custom Xpath that will work for all rows.

We have a guide on creating Xpaths in the Knowledge Base

https://kb.workfusion.com/display/RPAe/XPath+Guide

Thanks a lot for your help.

I don’t know the reason behind but in my case I had to use " instead of ’ otherwise the Xpath does not work. Maybe it could help some users …

Rgds,

L

What do you mean by using “instead of”? Could you please share en example of how you use it, I didn’t quite get it…

Instead of using Xpath => //table[contains(@id,‘ResultResearchGridView-record’)][${counter}]
I had to use Xpath => //table[contains(@id,“ResultResearchGridView-record”)][${counter}]
I simply replaced ’ by " otherwise the Xpath was not found by Workfusion and Chrome (Ctl F in element window).

L.

Oh, got it! Thank you :slightly_smiling_face: