Issue
How to count the number of elements are matching with for the given xpath expression
xpath: driver.findElement(By.xpath("//div[contains(@id,'richedittext_instance')]"))
all i need is the count.
Solution
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.
Answered By - Manigandan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.