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.

Test Flow Logic based on previous step or data source value rather than test suite variable

goofy78270
goofy78270 Posts: 133

Is it possible to base test flow logic (variable condition) based on a datasource row of the current runs value or a databank value pulled from a previous test step?

Comments

  • jakubiak
    jakubiak Posts: 795 admin

    Yes - you can create a test suite variable of type "Data Source" and link to a specific column of a specific data source, and the variable will contain the value in that column based on the current row in the data source iteration. In addition, in a data bank tool you can go to the "Data Source Column" section and choose to write the value to a test suite variable.

  • goofy78270
    goofy78270 Posts: 133

    If using a datagroup, how would I select the appropriate datasource based on the test run as the datagroup is flipping sources based on an environment variable?

  • jakubiak
    jakubiak Posts: 795 admin

    You cannot flip the data source in the data group while the test scenario is executing and iterating over data source rows. You control which data source is used by the data group at the start of your test execution - once the execution starts and the data source has been chosen, it gets used for the rest of the scenario.

  • goofy78270
    goofy78270 Posts: 133

    Sorry, maybe I did not state that right. I am not looking to change the datasource during a test run, I am looking to determine the selected datasource in use. Currently we flip datasources based on environment variables ${dataSourceEnv}.

  • goofy78270
    goofy78270 Posts: 133

    I was looking for something like context.getDataSource(), but that did not work.

    I think ${soa_env:dataSourceEnv} may work however though.

  • jakubiak
    jakubiak Posts: 795 admin

    There is no way to query the data group for which data source it is currently using. Your best bet is to query the value of the environment variable as you suggested.