Issue
I'm new to selenium web driver and I need to select multiple checkbox to Submit the form and the following code response in HTML format.
Please find the attached screenshot and kindly suggest an idea to select multiple checkbox, random etc...
Solution
A bit modified @djangofan answer (his code selects not only checkbox inputs):
List<WebElement els = driver.findElements(By.xpath("//input[@type='checkbox']"));
for ( WebElement el : els ) {
if ( !el.isSelected() ) {
el.click();
}
}
Answered By - rgrebski
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.