WebTable Row and Colum Count

Ask general questions here.
mani
Posts: 3
Joined: Thu Sep 09, 2010 12:33 pm

WebTable Row and Colum Count

Post by mani » Thu Sep 16, 2010 4:09 am

How to get Row Count and Column Count in a Webtable , I need to get particular Cell value in a webtable using Row number and column number.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: WebTable Row and Colum Count

Post by Support Team » Thu Sep 16, 2010 9:04 am

Hi,

the easiest way to achieve the information you need is to make use of the RxPath.
Here is a sample code for getting row count and column count:
// get all rows in table and store them in a list 
IList<Ranorex.TrTag> myRows = table.FindDescendants<Ranorex.TrTag>();
// print out count of rows stored in a list 
Report.Log(ReportLevel.Info,"Row Count: ", myRows.Count.ToString());
		
// get all columns in specified row and store them in a list 
IList<Ranorex.TdTag> myCols = myRows[2].FindDescendants<Ranorex.TdTag>();
// print out count of columns stored in the list 
Report.Log(ReportLevel.Info,"Column Count: ", myCols.Count.ToString());
Regards,
Peter
Ranorex Team
.
Image

mani
Posts: 3
Joined: Thu Sep 09, 2010 12:33 pm

Re: WebTable Row and Colum Count

Post by mani » Fri Sep 17, 2010 5:45 am

Thanks , i can get the row and column count .

How to get the "cell value" using row number and column number .

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: WebTable Row and Colum Count

Post by Support Team » Fri Sep 17, 2010 8:32 am

Hi,
mani wrote:How to get the "cell value" using row number and column number .
You can use the index of the list. For example
myRow[1].myCell[2].InnerText
Please also take a look to following documentation http://dotnetperls.com/list

Regards,
Peter
Ranorex Team
.
Image