I am struggling with finding the best way to configure my tests dynamically.
I am logging into one of 4 or 5 servers. Sometimes I can use the same username/password pair and sometimes I cannot. I would also like to set environment variables specific to each environment. The only way I can do it now, is this. Say I have a "MyWebTest" to run. The first step is a code step that can log in and set variables. Everything after the login is in MyWebTestStep. What I have to do now is create 5 tests:
MyWebTestAAA: (1) LoginStepAAA (2) MyWebTestStep
MyWebTestBBB: (1) LoginStepBBB (2) MyWebTestStep
MyWebTestCCC: (1) LoginStepCCC (2) MyWebTestStep
and so on. This seems lame.
Or I can have the LoginStep do all of the configuration.
If I am running a test as a test, I have the 3 properties: CustomProperty1, CustomProperty2, CustomProperty3. I can put information in those and pull out the configuration info that I want.
If I am running a test within a test list, there is only one property that I can use, or mis-use. That the is baseUrl. Nothing else allows me to add arbitrary text. I can put http://url.com?env1=this&env2=that. And then I can put information in those and pull out the configuration info that I want.
But what I would like is o have only one "MyWebTest" and run a test list and, within that, run "MyWebTest" configured for AAA, the run in configured for BBB and then run it configured for CCC and I cannot do this. Again, I want to do this without having to create multiple copies of "MyWebTest".
If I do something using the custom properties, I can only use it when running as a test. If I use the baseUrl, I can only use it when running as a test. If I do both in different places, these things fight against one another. Is there a reasonable way to do this?