I want to mark all the checkboxes in a page using selenium webdriver?
How can I implement that?
First, assign all checkbox elements to a list.
List<WebElement> list = driver.findElements(By.Xpath("//input[type='checkbox']"));
Then, loop through the list, for example
for(WebElement el : list){
if(!el.isChecked()) // validate Checked property, otherwise you'll uncheck!
el.click();
}
List <webelement> checkboxele= driver.findelements(By..whatever property you wish, id or xpath")
for(webelement ele:checkboxele){
ele.click();
//Thread.sleep(1000); depends
}
This will click on all checkboxes in your page.