Monday 4 July 2016

How to find total number of rows and columns in a table in Selenium

We can use below XPATH expressions to find count of rows and columns in a table.

  1. //table//th  - Find total number of columns in a table. Note that this will only work if all columns are marked using th tag
  2. //table//tr - Find total number of rows in a table.
  3. //table//tr[1]//td - Find total number of TD tags inside a given table row. 

What do you think on above selenium topic. Please provide your inputs and comments. You can write to me at reply2sagar@gmail.com

No comments:

Post a Comment

Buy Best Selenium Books

Contributors