I have already checked many answers but all are using a foreach
loop to iterate through rows. I want to use a for
loop.
Code:
IWebElement NtTable = driver.FindElement(By.Id("nt-item-table"));
IReadOnlyCollection<IWebElement> TableRows = NtTable.FindElements(By.TagName("tr")).ToList();
for (int i = 0; i <= TableRows.Count; i++)
{
//driver.FindElement(TableRows[i])....
//Tablows.get(i)....
}
I tried above commented 2 lines to get text of particular TD from particular TR but seems not getting any property after press (.)
. Above seems fine if I use Java but not in C#.