How can get the count or the number of div class in the mentioed screenshot in Selenium with java?

23 views Asked by At

enter image description here

I want to extract the marked div count in selenium and java.

1

There are 1 answers

0
sashkins On

You are working with the parent div while asking about its children.

Try the following:
CSS:

driver.findElements(By.cssSelector("#tbodyid > div"))

xPath:

driver.findElements(By.xpath("//div[@id='tbodyid']/div"))