Hey everyone,
I'm having trouble trying to figure out the most efficient way to build my suite of tests. The issue is, I have tests that do environment specific things. For example, in one of my tests, I query our qa environment database to get a specific value back which is then used to help datadrive the test. Now what if I want to run this same test in UAT or Prod? This means I need to change in all the tests which environment I am pointing to. I want to be able to just have to change one value in a test and then everything will run in the correct environment.
My idea was creating a custom C# class that has functions that based on which environment you are in, returns the correct value.
Here's a quick example of what I want.
public String getUrl(Environment env)
{
if(env == Environment.QA)
{
return "qaurl";
}else if(env == Environment.UAT)
{
return "uatUrl"
}
}
Is this possible in Test Studio? If so, where can I create my C# class to use and reference it in my project? I am not familiar with the C# way since I'm coming from a Java background.
I'm having trouble trying to figure out the most efficient way to build my suite of tests. The issue is, I have tests that do environment specific things. For example, in one of my tests, I query our qa environment database to get a specific value back which is then used to help datadrive the test. Now what if I want to run this same test in UAT or Prod? This means I need to change in all the tests which environment I am pointing to. I want to be able to just have to change one value in a test and then everything will run in the correct environment.
My idea was creating a custom C# class that has functions that based on which environment you are in, returns the correct value.
Here's a quick example of what I want.
public String getUrl(Environment env)
{
if(env == Environment.QA)
{
return "qaurl";
}else if(env == Environment.UAT)
{
return "uatUrl"
}
}
Is this possible in Test Studio? If so, where can I create my C# class to use and reference it in my project? I am not familiar with the C# way since I'm coming from a Java background.