I have a problem and having trouble to finding a solution.
Problem Statement:
Navigate to a webpage and check if three checkboxes are selected. If not, I'd like to select them (if only one is selected, I'd like to select the other two and etc). If they are already selected, then exit the page.
I have declared these 3 elements with xpath as below :
IWebElement aaa = driver.findElement....
IWebElement bbb = driver.findElement....
IWebElement ccc = driver.findElement....
I would like to wrap the above elements into a variable perhaps to do something like this:
var threeCheckboxes = aaa, bbb, ccc
So I could get a potential conditional statement like:
if (threeCheckboxes.Selected){
...
}
else{
select the three boxes(etc)
}