Selenium 1 uses 'getXpathCount' method to find the Xpath count of an atribute in the screen.
But in Selenium2 webdriver it is done by the following way:
int xpathCount= webDriver.findElements(By.xpath("//div[@id='billingProfiles']/div[@class='cardContainer']")).size();
please note that we are using 'findElements' instead of the usual 'findElement' method.
But in Selenium2 webdriver it is done by the following way:
int xpathCount= webDriver.findElements(By.xpath("//div[@id='billingProfiles']/div[@class='cardContainer']")).size();
please note that we are using 'findElements' instead of the usual 'findElement' method.
Thank you for sharing! It's exactly what I was looking for.
ReplyDeleteYou're welcome
Delete