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

Ask general questions here.
deviraghu
Posts: 2
Joined: Tue Apr 28, 2015 10:20 am

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

Post by deviraghu » Thu Apr 30, 2015 9:13 am

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

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

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

Post by krstcs » Thu Apr 30, 2015 1:39 pm

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].
Shortcuts usually aren't...

deviraghu
Posts: 2
Joined: Tue Apr 28, 2015 10:20 am

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

Post by deviraghu » Mon May 04, 2015 1:28 pm

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.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

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

Post by krstcs » Mon May 04, 2015 4:45 pm

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]
Shortcuts usually aren't...

Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

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

Post by Fergal » Fri May 15, 2015 12:05 pm

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.