Skip to content

PoiExcelUtil.getTableDataAsMap returning RuntimeException: Lable Data2 for ending data range not found in sheet DataTable when all Data Key starts from same column #404

Description

@patelvinay11

QAF Version: 3.0.1 and above

Steps To Reproduce

1. call PoiExcelUtil.getTableDataAsMap("testdata.xlsx","Data2","DataTable");
2. use [testdata.xlsx](https://github.com/qmetry/qaf/blob/master/test/resources/testdata.xlsx)
3. update testdata.xlsx to start the data for Data2 from C19 or B19 or A19, instead of I19.
4. Run a test.

Expected behavior

return data object

Actual behavior

line 242: Cell tableEnd = findCell(sheet, tableName, startCol + 1, startRow + 1); returning null, so it's throwing RuntimeException: Lable Data2 for ending data range not found in sheet DataTable
Note: test is working only if data starts from any column after D19 only.
I think fix is required in findCell method in PoiExcelUtil class, as Data sheet can start of any column should not impact the outcome.

Is the issue reproducible on runner?

  • [] QAS
  • Maven
  • Gradle
  • [] Ant
  • Eclipse

Test case sample

Please, share the test case (as small as possible) which shows the issue
Not required as code is already available to debug in qaf.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions