I am using the following code to get the id of a row that is randomly generated:
string[] rowIds = new string[numofRowsPassengerTable];
for (int counter=1; counter < numofRowsPassengerTable; counter++)
{
rowIds[counter] = browser.GetAttribute("xpath=//table[@id='tblPassengers']/tbody/tr[counter]@id");
}
But the above is not returning anything. If I use 1
or 2
instead of counter
it returns the id. Any idea how can I use that counter to get row ids?