Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

SOAtest using dynamic Excel Datasources

dgoedh
dgoedh Posts: 63

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

Tagged:

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited July 2019

    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.

  • dgoedh
    dgoedh Posts: 63

    Thanks for the heads up. Is there any way for us to empty the cached data 'by hand'?

    Regards,

    Daniel

  • dgoedh
    dgoedh Posts: 63

    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.
    Daniel

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭

    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?

  • dgoedh
    dgoedh Posts: 63

    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.

  • dgoedh
    dgoedh Posts: 63

    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.

Tagged