Unable to fill the background color in xlsx file

I am Kiran and beginner and quick learner on Selenium Tool.
Query : — Unable to fill the background color in xlsx file

SetData function

public void SetData(int rowNum, int colNum, String sheetName, String setValue, short cellColor)

FileInputStream fis = new FileInputStream(new File(read.ObjectRepoData(“testdata”)));
XSSFWorkbook workbook = new XSSFWorkbook (fis);
XSSFSheet sheet = workbook.getSheet(sheetName);

CellStyle style = workbook.createCellStyle();

//Create First Row
XSSFRow row = sheet.getRow(rowNum);
XSSFCell col = row.createCell(colNum);


FileOutputStream fos =new FileOutputStream(new File(read.ObjectRepoData(“testdata”)));


Passed below line in the test case:

excel.SetData(1, 4, “Login”, “PASS”,IndexedColors.GREEN.getIndex());

Can any one help me on this please?

Default Asked on April 2, 2019 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.