Forum Discussion
So after all that trial and error, it looks like it finally accepted that 'testenvironment' in the script. So now, when I kick off the tests with the script, they'll run in that QA environment. Now I'm having a slightly different problem....
So, if I change that parameter in the Powershell script to /testenvironment=LIVE instead of /testenvironment=QA to run the tests in a different environment, it's still running the tests in that QA environment. I have function in my TestComplete script that is supposed to update the variable values when the test environment changes, but the values don't seem to be changing.
Here's the function that I have:
function creds(){
switch (ProjectSuite.Variables.environment){
case "QA":
ProjectSuite.variables.url = "https://qa.testsite.com/";
ProjectSuite.Variables.userName = "username";
ProjectSuite.Variables.password = "password";
Log.Message(ProjectSuite.Variables.url);
break;
case "LIVE":
ProjectSuite.Variables.url = "https://testsite.com/";
ProjectSuite.Variables.userName = ProjectSuite.Variables.ProdUsername;
ProjectSuite.Variables.password = ProjectSuite.Variables.ProdPassword;
Log.Message(ProjectSuite.Variables.url);
break;
}
}
Any ideas on how I can get it to change the variable values when I want to kick the tests off in Live?
What you have there looks good on the surface, really. My question is whether or not the "environment" variable is getting set properly before you go into that function. What happens if you put a Log.Message(ProjectSuite.Variables.environment) entery right before your switch statement? Make sure that the environment is being set properly before you go into the switch.
Related Content
Recent Discussions
- 9 hours agoSubhraDas