0

I'm working with excel sheets for that i'm using data Provider concept. For less number of columns/data my code is working. But for more number of columns or huge data i'm getting StackOverFlowError.

I tried the same code by deleting some columns in same Excel sheet,Error is resolved. But when i'm adding new columns to that sheet i'm getting same error.

public class TestCase1{
@Test(dataProvider = "getData")
public void Test1(LinkedHashMap<String, List<Object>> map){
System.out.println("Test case is passed");
} 
@DataProvider 
public Object[][] getData() throws Exception {
String path = "sheetForTest.xlsx";
Object[][] testObjArray = 
ExcelManager.getExcelSingleUnitsAndMultipleValues(path,"Excel_Sheet1");
        return (testObjArray);
    }
}
Anil
  • 43
  • 1
  • 6

1 Answers1

0

Take a look at the following post to understand what is stackOverFlow and how to deal with it:

What is a StackOverflowError?

There is no "magic" solution for this, you will have to investigate deeply and carefully your code and your stack traces to understand where you can improve it.

One thing I can recommend is to try and distribute the work you want to do into smaller pieces and run in in parallel/sequence in different processes according to your need.

Adi Ohana
  • 927
  • 2
  • 13
  • 18