Page 1 of 1

WebTable related- How to find row number based on cell text

Posted: Thu Apr 30, 2015 9:13 am
by deviraghu
Hi,

can anyone guide me, is there any option to know the row number in a web table based on cell text.
it is something like., get_row_with_cell_text

your help is appreciated.

Thanks,
Raghu

Re: WebTable related- How to find row number based on cell text

Posted: Thu Apr 30, 2015 1:39 pm
by krstcs
Standard web tables do not have cells, they have tr and td tags, which might have any number of other elements inside them, so we would need more information about your system under test (SUT) before being able to help.

Please include a Ranorex Snapshot (not a screenshot) of the element in question. You can find information on creating a Ranorex Snapshot here. If you can't or don't want to post it on the forums, you can send it to [email protected].

Re: WebTable related- How to find row number based on cell text

Posted: Mon May 04, 2015 1:28 pm
by deviraghu
Yes, sorry for that, those are not cells.

My requirement is, we have 3columns,
in 2nd column we have account number, based on this number we need to validate the values of 1st and 3rd columns.

First I need to findout the row number of that Account Number(as input) and capture the values for 1st and 3rd columns(outputs) from the same row?

How I can handle this scenario?

Thanks & Regards,
Raghu B.

Re: WebTable related- How to find row number based on cell text

Posted: Mon May 04, 2015 4:45 pm
by krstcs
My suggestion would be to create an xpath that uses relationship operators for a rooted folder, then add the columns as children. They will always refer to the tds under the Row that has a td with text = account number.

Code: Select all

Row (Rooted folder) => /table/tbody/tr/td[@text=$varAccountNumber]/parent::tr
..Column1 => /td[1]
..AccountNum => /td[2]
..Column3 => /td[3]

Re: WebTable related- How to find row number based on cell text

Posted: Fri May 15, 2015 12:05 pm
by Fergal
The "RanoreXPath Part Two" video on this page (scroll down towards the botton) could be worth viewing, I think it covers a lot of what you want to do.