Test Flow Logic based on previous step or data source value rather than test suite variable
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
-
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.
0 -
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?
0 -
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.
0 -
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}.
0 -
I was looking for something like context.getDataSource(), but that did not work.
I think ${soa_env:dataSourceEnv} may work however though.
0 -
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.
0