How to count no of rows in table from web application using selenium python webdriver


Question

How to count the rows in the table from web application by using selenium python web driver. Here we can retrieve all data in the table from web application but couldn't count the rows and columns, please give me idea of how to do this.

1
13
2/4/2018 1:44:37 PM

Try some thing like this

int rowCount=driver.findElements(By.xpath("//table[@id='DataTable']/tbody/tr")).size();

int columnCount=driver.findElements(By.xpath("//table[@id='DataTable']/tbody/tr/td")).size();

FYI : This is the implementation in java.

19
2/12/2013 4:15:58 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon