question

NickK avatar image
NickK asked NickK answered

How to find row id with td information

Hello,

I have a table to which rows can be added and deleted. This table can contain mutiple entires of the same data, such as a name. What I would like to do is return the rowid using a combination of td content.

For example:

Brian/Andrews/34 Road

Brian/Turner/19 Drive

I would like to produce an iTest entry to locate the rowid of Brian Turner using text() 'Brian' and '19 Drive'.

I would be extremely grateful for any advice provided.

iTestgui automationtable maptables
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

vijaykumar avatar image
vijaykumar answered vijaykumar edited

table.rar

We have to use the XPATH query to get the RowID.

Here is the command for your reference:

count(//row[FirstName='Brian' and LastName='Andrews']/preceding-sibling::*)

Attached is the testcase and response map for your reference.


rowid.png (33.4 KiB)
table.rar (1.4 KiB)
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

NickK avatar image
NickK answered

Hullo, many thanks for your kind response: what do you do when you do not have td tags, i.e, there is no "firstname/lastname" information, but just an incremented number?

For example, row 1 the values are 1-5, row 2 6-10?

Kind regards,

Nick

10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.