Friday, 27 December 2013

Selenium Webdriver - How to Count Checkbox in Dropdownlist -Example


WebDriver driver = new FirefoxDriver();

driver.navigate().to("http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/checkboxes/defaultcs.aspx");
WebElement checkdropdown = driver.findElement(By.id("ctl00_ContentPlaceHolder1_RadComboBox1_Input"));
checkdropdown.click();
try {
Thread.sleep(4000, 0);
} catch (InterruptedException e) {
e.printStackTrace();
}
List<WebElement> Checkbox = driver.findElements(By.className("rcbItem"));
int no;
no=Checkbox.size();
System.out.print(no);


No comments:

Post a Comment