Environment aware datasources
Hello,
I'm working with simple csv or excel file datasources and I want to be able to use different paths (\${environment_name}\source.csv) or settings depending on the environment I'm current using in the project/test, however environment values like ${name} are not being recognized. I do see some remarks on the help pages about this but my question is if it is posible to make this type of datasources environment aware. If not then whats the best practice used to solve this?
Comments
-
In data source editors, you may need to use "soa_env" prefix like ${soa_env:var_name}.
0 -
I'm creating a global datasource and setting the path to c:/ds/${soa_env:NAME}, that doesnt sit well with soatest
And when I try to use it anyways, it also doesnt work.
is the scope of the datasource relevant?
0 -
It depends what you mean by "environment variable". System/OS environment variables vs SOAtest tst environment variables. In your case, I think you want ${env_var:NAME}.
0 -
If you are talking about SOAtest environments (as opposed to OS environment), I think the problem is because you are trying to use an environment defined in a .tst file in a global data source which is defined outside of any .tst file. Global data sources will not be able to resolve environment variables defined within a .tst. You would need to add your data source inside your .tst file to do that.
0