Xpath for each required row

@ashapkina

Is there any way to get data from these xpath by looping ??

//[@id=“content”]/div[1]/div/table/tbody/tr[2]/td[7]
//[@id=“content”]/div[1]/div/table/tbody/tr[3]/td[7]
//[@id=“content”]/div[1]/div/table/tbody/tr[5]/td[7]
//[@id=“content”]/div[1]/div/table/tbody/tr[8]/td[7]

@lakshmipriya_a you can save the whole column to a List variable using Xpath //[@id=“content”]/div[1]/div/table/tbody//td[7]

and then access the values you need in the List using Loop

SimilarXpathList.zip (1.3 KB)

@ashapkina dynamically the data will be changing here.

@lakshmipriya_a you need to save the column to a List using Web element action
SameXpathList.zip (670 Bytes)

1 Like

@ashapkina thank you its working :clap::clap::clap::bouquet:

1 Like

Hi.

I have some trouble with Xpath and on assigment 12 I played around a bit (even though were supposed to use clipboard) to learn and I got a question.

I managed to get the Xpath: //tr[contains(@class,‘TblRow’)] for the table and when I post it in the search row in Chromes dev I get 25 results.
image

And I added a index to get the second row and it worked:
image

So happy to get those working… however, when I use these in the code… the result is an empty variable:
image

image

image

Would you please shead some light on why my xpath isn’t working as I thought they would… and how to fix them.