This blog is for Automation Test Engineers

Sunday, 27 August 2017

How to check whether checkbox is selected or not


WebDriver driver=new FirefoxDriver();
driver.get("http://www.ksrtc.in/oprs-web/");
WebElement chkbox=driver.findElement(By.name("singleLady"));
boolean selected=chkbox.isSelected();
if(selected==true){
System.out.print("Selected");
}else{
System.out.print("not selected");
box.click();
}



0

0 comments:

Post a Comment