For single web element in that row i got index..for multiple column in a single row how to get the index:

IWebElement colelement = driver.FindElement(By.XPath("//div[@id='grdBooking']//table//tr/
String colidx = colelement.GetAttribute("idx"); 
Console.WriteLine("Colelement index is =" + colidx);
  • Can you add your table structure? – STE Jul 2 '18 at 4:43

You can get the index of multiple column elements from a single row using For or For-each loop.

First get the column count by using .size() method and use for loop for getting all the index of all elements from the column.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.