Quality Testing

Quality is delighting customers

How to count total number of rows of a table using Selenium?

Count total number of rows of a table using Selenium.

Views: 85

Reply to This

Replies to This Discussion

Hi Madhavi Latha ,

Hope you are doing great.

Here is the link that you can follow for creating tables in selenium webdriver.

https://stackoverflow.com/questions/33233883/getting-the-count-of-r...

Regards
Software testing company

List {WebElement} total_rows = driver.findElements(By.className("//table[@id='tableID']/tr"));

int totalRow = total_rows.size();

Hope this will work.

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2017   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service