Can't Count total rows in a table

Hi Everyone !!

I want to know how can I count total rows in the table. here is the example of the web structure (the picture just shown the table section, not the whole web)

Plz Help Me!

I tried 1 variant of code :
ArrayList Table = driver.findElement(By.xpath(‘//*[@id=“doemstic”]/tbody/tr’)) : it not worked

This Error : Test Cases/Domestic Plant Selected/New Order/Domestic Nomal Order/Mat HD/Domestic plant Selected Advance Search FAILED because (of) (Stack trace: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ‘[[CChromeDriver: chrome on XP (11c9032ed53ca34cee410b089411b5d0)] → xpath: //*[@id=“doemstic”]/tbody/tr]’

Any help from you will be great for me


use WebDriver.findElements(By) method rather than WebDriver.findElement(By). Be aware of ‘s’.

List<WebElement> Table =     driver.findElements(By.xpath('//*[@id="doemstic"]/tbody/tr'))
@4280-kazurayam  How to Show the number of counts.println(Table.size()) This not work.

Any message?

Do you have any