0

Our dataprovider is designed to retrieve a single row of data from an Excel file based on some key value that is passed in. This works fine for our test suites that have ~15 tests in it, but over the next couple of months, the tests will grow to a couple hundred, thus I have concerns on the impact of accessing the excel file once for every test (yes, the excel file will have one row for each test).

Is this a valid concern, from a performance/resource perspective? if so, how does one measure it? (I'm on a mac).

Using the @BeforeClass method, I could easily load all the data from an excel file into an object and have the dataprovider retrieve the data from the object. But again, i wouldn't know what the overhead of having that much data in memory would do.

Is there a best practice for this data?

Greg
  • 3,861
  • 3
  • 23
  • 58

1 Answers1

2

If you want to use dataprovider then this is the only way to implement, because before calling any of your test, data provider reads file and load data into memory and returns an Object[][].

And I don't think so it would overhead in memory and of-course if you have hundreds/thousands of data then Data Provider is the best practice and it should not be affect on you performance.

Amit Bhoraniya
  • 621
  • 3
  • 14