How to count the number of elements are matching with for the given xpath expression
xpath: driver.findElement(By.xpath(\"//div[contains(@id,\'richedittext_insta
Try this code:
//Assume driver is intialized properly. int iCount = 0; iCount = driver.findElements(By.xpath("Xpath Value")).size());
The iCount has the number of elements having the same xpath value.
iCount
xpath