Watin : Get Row Count from table
Hi i'm trying to get a row count from a table using Watin ie
1.Get the table (done) 2.Count the rows in the table (not done) 3.Compare the count (already have an idea)
How do i get the row count from the table,using watin?Any ideas?Can someone point me to the right direction
Hi Guys;thanks for helping,i hit another roadblock here i'm using something like this
int CountN开发者_开发知识库umberOfRows = this.elements.JobListingGrid.OwnTableRows
.Skip(1)
.Where(r => !r.ClassName.Contains("rowHidden"))
.Count();
Ok i'm able to get the count now its '21' :),My problem is the page is using the same control,and the number of row for each page is the same if i click the Activelink the rows is 21 and if i click on Pendinglink although the rows are hidden it will still be 21.I need to differentiate the number of rows because that is the only way for me to do this
if (CountNumberOfRows != 0)
{
this.Elements.ActiveLink.Click();
}
else
{
this.Elements.PendingLink.Click();
}
Is my idea possible?Or do i need to look at another way
If you already have the table then the TableRows collection gives you the number of rows:
table.TableRows.Count;
精彩评论