//Checking
public void CheckingChkbox(WebElement chkbx1){
boolean checkstatus;
checkstatus=chkbx1.isSelected();
if (checkstatus==true){
System.out.println("Checkbox is already checked");
}
else
{
chkbx1.click();
System.out.println("Checked the checkbox");
}
}
//Unchecking
public void UnCheckingChkbox(WebElement chkbx1){
boolean checkstatus;
checkstatus=chkbx1.isSelected();
if (checkstatus==true) {
chkbx1.click();
System.out.println("Checkbox is unchecked");
}
else
{
System.out.println("Checkbox is already unchecked");
}
}
Showing posts with label Uncheck checkbox. Show all posts
Showing posts with label Uncheck checkbox. Show all posts
Monday, October 24, 2011
Checking and Unchecking Web Checkbox
We can use the below methods to check or uncheck web checkbox.
Subscribe to:
Posts (Atom)