I'd like to use for loop for these to click them from 1st checkbox - 4th checkbox for my test automation.
webdriver.findElement(By.cssSelector("#mat-checkbox-1 .mat-checkbox-inner-container")).click();
webdriver.findElement(By.cssSelector("#mat-checkbox-2 .mat-checkbox-inner-container")).click();
webdriver.findElement(By.cssSelector("#mat-checkbox-3 .mat-checkbox-inner-container")).click();
webdriver.findElement(By.cssSelector("#mat-checkbox-4 .mat-checkbox-inner-container")).click();
I've tried the code below but it's still not working.
for(int i=1; i>=4; i++){
webdriver.findElement(By.cssSelector("#mat-checkbox-"+i+".mat-checkbox-inner-container")).click();
}
webdriver.findElementoperations?