In selenium you can check if the specific checkbox is ticked or not by using the below code:
WebElement webelement = driver.findElement(By.id("checkbox_id");
Boolean checkboxStatus = element.isSelected();
Note: isSelected() method returns true or false based on wheather the checkbox is ticked or not respectively.
To write the checkbox Status in the excel you will need to use Apache POI jar.
Apache POI is a popular API that allows programmers to
create, modify, and display MS Office files using Java programs.
Below is the code to update an existing Excel File:
String excelFile_Path = "C:\\Users\\xyz\\Desktop\\test.xlsx" ;
FileInputStream fis = new FileInputStream(new File(excelFile_Path));
XSSFWorkbook workbook = new XSSFWorkbook(fis);
XSSFSheet sheet = workbook.getSheetAt(0);
Cell cell = = sheet.getRow(0).getCell(0);
cell.setCellValue("true");
FileOutputStream fos = new FileOutputStream(new File(excelFile_Path));
workbook.write(fos);
fis.close();
fos.close();
workbook.close();