To Test a Multiple Checkbox with in Single Click.
When the Checkbox element contains with Same (Name-Locator).
WebDriver t=new ChromeDriver();
t.get("url");
List<WebElement> s=t.findElements(By.name("email_to[]")));
System.out.println(s.getSize());
for(int i=1;i<s.getSize();i++)
{
s.get(i).click(); ---->Select the Dropdown
s.get(i).click(); ---->Deselect the Dropdown
}
When the Checkbox element contains with Same (Name-Locator).
WebDriver t=new ChromeDriver();
t.get("url");
List<WebElement> s=t.findElements(By.name("email_to[]")));
System.out.println(s.getSize());
for(int i=1;i<s.getSize();i++)
{
s.get(i).click(); ---->Select the Dropdown
s.get(i).click(); ---->Deselect the Dropdown
}
No comments:
Post a Comment