Forum Discussion
Just out of curiousity... disable the new function for the environment parameter and remove that parameter from your powershell and try again.
What it seems to me is that there is something in your actual project suite that is attempting to run an Environment Manager set of tests. If we remove the command line parameter and associated code and still get the error, then we know we need to look elsewhere for the solution.
So I disabled the environment function and removed that environment parameter from my Powershell script and it kicked off the tests and there was no Environment Manager error. So something about the environment function (or possible the parameter in Powershell) seems to be the cause of the problem.
- tristaanogre8 years agoEsteemed Contributor
Aha! That's it... There is actually a reserved commandline parameter for TestComplete/TestExecute of /environment or /env that triggers environment manager tests.
Change the parameter to something like 'testenvironment' and use that string in your javascript function.
- nicklott8 years agoOccasional Contributor
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?
- tristaanogre8 years agoEsteemed Contributor
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.