Multiple inserts into excel using POI

After performing my test I insert Pass or Fail into the verification column of my spreadsheet.
Now I want to insert the date in another column in the same row.
This fails and corrupts my file. Can you help?

public void runTest() throws Exception {

try {
PageFactory.initElements(driver, LoginPage.class);
PageFactory.initElements(driver, HomePage.class);

if (BaseClass.bResult == true) {
 //String date = new Date().toLocaleString();
ExcelUtils.setCellData(“Pass”, iTestCaseRow, Constants.resultCol);
 //ExcelUtils.setCellData(date, iTestCaseRow, Constants.dateCol);
} else {
throw new Exception(“Test Case failed because of vrification”);
} catch (Exception e) {
ExcelUtils.setCellData(“Fail”, iTestCaseRow, Constants.resultCol);
Utils.takeScreenshot(driver, sTestCaseName);
throw (e);

oseic Default Asked on November 27, 2015 in Selenium WebDriver.
Add Comment
0 Answer(s)

Your Answer

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