How to find total number of checkboxes in a page using selenium webdriver

package selenium_examples;

import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;


public class Sample {

public static void main(String[] args)
{

WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.co.in/preferences?hl=en#languages");
driver.findElement(By.linkText("Edit")).click();

       Listcheckboxes=driver.findElements(By.xpath("//input[@type='checkbox']"));
System.out.println("Total Checkboxes ="+checkboxes.size());

}
}




Output :-

Total Checkboxes =46


checkboxes count webdriver selenium



No comments:

Related Posts Plugin for WordPress, Blogger...

Fun and Knowledge