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.

Can you provide an example of a writable datasource in Virtualize?

Options
jefftuckerbofa
jefftuckerbofa Posts: 234

Can you provide an example of a writable datasource in Virtualize?

Thanks,

JT

Answers

  • benken_parasoft
    benken_parasoft Posts: 1,231 ✭✭✭
    edited June 2023
    Options

    The Writable data source is not something you add to Virtualize responder suites. In fact, you won't see Writable in the Add Data Source dialog.

    The Writable data source is something you can use in a Virtualize provisioning action suite or a SOAtest test suite. It is intended so one action/test can write lists of values down the rows of the Writable data source then have a subsequent action/test or suite iterate over the values, row-by-row. A Writable data source is written to by a Data Bank tool where you would configure one or more extractions that select a list of values and configure which Writable data source column to store those values.

  • jefftuckerbofa
    jefftuckerbofa Posts: 234
    Options

    Does it sound reasonable for me to handle persistence in a custom Java solution called through an extension tool? Thanks for the quick response. JT

  • benken_parasoft
    benken_parasoft Posts: 1,231 ✭✭✭
    edited June 2023
    Options

    For persistence, you have various options.

    One option is to use the Correlation data source where you can use a relational (SQL) data base for persistence. See CRUD Support for SQL Databases in Virtualize

    Data Bank values are also persisted across responder invocations. So, if you were to invoke one responder that has a Data Bank then you can make a second request to a completely different responder which can read the current value of that same Data Bank.

    Or you can persist data some way through the Extension tool. Our scripting API provides a ScriptingContext object which has generic methods put(String, Object) and get(String) methods. You could call suiteContext = context.getNamedContext("name of my responder suite") to get the context for the responder suite. Then you can call suiteContext.put("someKey", someValue) to save a value and suiteContext.get("someKey") to retrieve it later.

  • jefftuckerbofa
    jefftuckerbofa Posts: 234
    Options

    I will try this out and report back. Thanks very much for this info!

    JT