Data Repository - Accessing and updating from script?
Looking for some guidance please as I am new to Parasoft.
I have searched this forum for every search I could think of and googled searches as well.
I have a requirement to increment a counter that will be used in a virtual service. Each time I increment I want to save to new counter value back to the data repository, overwriting the previous value. I have tried using data sources: CSV, Excel, Table, Writable and even though I did manage to write value back to a CSV file, the next time I called the service it reverted back to original number on every run. After researching I discovered that these data sources do an initial load at start of run and although can increment it reverts back to original value in next run.
Hopefully I have understood this correctly, that using a Data Repository as a Global Data Source will enable me to increment a counter and write back to Data Repository and then next run will pick up new value. If someone can confirm this that would be great.
My current dilemma is understanding what the syntax is to read value from Data Repository and then after I have incremented, updating the same counter with new value.
My plan was to call a groovy script from field on response to read Data Repository, increment and write back before returning newly increment value.
Is this possible?
Appreciate any help on this. Thanks