SOAtest using dynamic Excel Datasources
Hi,
I use _dynamic _Excel sheet (XSLX) as a datasource for the DBtool to make sql inserts. The Excel =TODAY -formula is used to put today's date in a field. This works well, also with highly concatenatied queries. OK.
However on the long run it seems that SOAtest is treating such a datasource as static, because when I repeat the test, a previous date is used. Even when refreshing the tst by double-clicking on the tst-box, this does not give the desired result.
Only when creating a new tst and attaching the same Excel sheet, the correct date is parsed and hereby the old tst's are also 'refreshed'.
Any ideas?
Thanks in advance and have a good weekend.
Regards,
Daniel
Comments
-
Data sources are "refreshed" (reloaded from disk) once at the begging of each test run before any tests have executed. That data is then cached and used for the entirety of the test run. In other words, the latest values should always be picked up at execution time.
0 -
Thanks for the heads up. Is there any way for us to empty the cached data 'by hand'?
Regards,
Daniel
0 -
Is it e.g. possible to flush the SOAtest cache using the Extension Tool with a jython or java command? In case of a positive answer, can you please provide an example script? Thanks in advance.
Daniel0 -
As mentioned, the cached excel data is flushed and reloaded from disk at the very start of test execution. Are you saying you need the data to be flushed and reloaded again at some point in the middle of your test run, like what was read in the beginning of the run isn't good anymore? There might be some internal API you could call from an Extension tool to but I don't have a code snippet offhand and using internal APIs isn't supported anyway.
Instead of relying on an Excel formula to give you the current date why not use something else like the Data Generator tool?
0 -
Thanks again for your wisdom and insight. I would surely try to use the Data Generator tool you refer to in the future, however currently we rely heavily on testdata in Excel that we have to migrate from existing automated modules, so the internal Excel formula's are quite handy and easy at the moment.
I already discovered a 'reasonable' work around and that is to open the Excel workbook and save it again to disk beforehand, that ensures that the expected data are picked up by SOAtest. Refreshing the tst is not necessary in particular.0 -
Opening and closing the Excel datasource from within SOAtest, using the Extension Tool and the apache.poi library functions (with e.g. jython) however, does not recalculate the formulas, although the timestamp of xls is updated on disk. Somehow you need the Excel application itself to recalculate the workbook.
0