Forum Discussion
- Hi!
sure, this is the main use-case for the data-connection functionality! Set up your connection(s) at the project level and in your DataSource/DataSinks select the "Data Connection" option (instead of JDBC), there you can select which project-level connection to use.
Hope this helps!
regards,
/Ole
eviware.com - Andrew_ShirshacNew ContributorYes, I have it set up like this. I have 3 different project level datasources, each specific to a database environment. However, i have, 10 test suites, and each suite uses 2 data steps (20 data steps in entire project). Doesn't that mean i'd have to go into all 20 steps and set the datasource in each? I was hoping to set it once at project level and then have it used by all 20 steps. This would give me the ability to point the tests at different environments very quickly with minimum change.
I'm attaching an image of the data sources and how they are sprinkled through the project in case i'm not doing something correctly. - Hi!
ok.. I see your point.. hmm.. this isn't easily achieved unfortunately, what we could do is allow property-expansion in the dataconnection field, so you could specify ${#Project#CurrentConnection} which will refer to a project level property holding the name of the connection you want to use.. then you only need to change the value of this property to change the connection for your tests..
Does that make sense?
regards!
/Ole
eviware.com - Andrew_ShirshacNew ContributorThat's exactly it and would be ideal.
I think a version of it already works. I tried using the following in the 'ConnectionString' property.
jdbc:oracle:thin:userid1/PASS_VALUE@${#Project#projectHost}:${#Project#projectPort}:${#Project#projectSid}
of a ConnectionSource called: ProjectConnectionSource
and then separately set the values for:
${#Project#projectHost}
${#Project#projectPort}
${#Project#projectSid}
and that worked as a simple test. Next I would need to conditionally set them (and the endpoint) based on some 'EnvironmentProperty'.
Then I should be able to use ProjectConnectionSource in all the data steps. - Hi Andrew,
you could maybe create an onLoad script for your Project (in the project windows' first tab) that sets these properties as desired? Alternatively you can override them with -P= when using the command-line runners.
Does that help?
regards!
/Ole
eviware.com