Saturday, March 28, 2015

How to Verify the check the box is selected or not in Selenium

 
 
 
List<WebElement els = driver.findElements(By.xpath("//input[@type='checkbox']"));
for ( WebElement el : els ) {
    if ( !el.isSelected() ) {
        el.click();
    }
}

No comments:

Post a Comment

TestNG - Can i use the 2 different data providers to same @test methods in TestNG?

public Object [][] dp1 () { return new Object [][] { new Object [] { "a" , "b" }, new Obje...