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

goofy78270goofy78270 Posts: 93

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

  • jakubiakjakubiak Posts: 669 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.

  • goofy78270goofy78270 Posts: 93

    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?

  • jakubiakjakubiak Posts: 669 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.

  • goofy78270goofy78270 Posts: 93

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

  • goofy78270goofy78270 Posts: 93

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

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

  • jakubiakjakubiak Posts: 669 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.

Sign In or Register to comment.