Contributions
Re: How To Use Parameters To Change The URL
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?2KViews0likes1CommentRe: How To Use Parameters To Change The URL
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.2KViews0likes3CommentsRe: How To Use Parameters To Change The URL
Thanks for responding! We use Octo as opposed to Jenkins. I know there's a place in Octo where you can set the environment that you want to deploy to. What we're trying to do is capture the environment from Octo, and set the environment variable in the ProjectSuite to be whatever that Octo environment is, so that the tests kick off when we deploy. It's virtually the same thing that you're describing, except we're trying to use Octo to do it instead of Jenkins. Could you share an example of the TestComplete script that you guys are using to pull the environment value down from Jenkins?2.1KViews0likes1CommentRe: How To Use Parameters To Change The URL
Ok so I've made the changes that you suggested, and here's where I'm at: When I run the Powershell script, it opens TestExecute, but when it runs my TestComplete script, it errors out on this line: ProjectSuite.Variables.Environment = ogreUtils.getTCCommandLineParam(environment); I get an error that says "You cannot run Environment Manager tests with TestExecute". So instead of using environment, I used this instead: ProjectSuite.Variables.Environment = ogreUtils.getTCCommandLineParam(env); I also updated my Powershell script to say /env=qa instead of /environment=qa. When I ran it this time, I didn't get that Environment Manager error, but I did get an error that said that env was not defined. How can I define env so that I can run that TestComplete script?3.8KViews0likes7CommentsRe: How To Use Parameters To Change The URL
Question about the custom command line parameter script extension that you referenced: the getTCCommandLineParam. What do I need to do to get that parameter and use it in my TestComplete script? Here's an example of what I'm thinking: Powershell script: $testexecute = "C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\TestExecute.exe" $p = Start-Process -filepath $testexecute "`"X:\QA\Automated Testing\Vortex\Vortex.pjs`"", /environment qa, /run, /exit TestComplete Script: function environment() { //Set environment and browser variables based on parameter ProjectSuite.Variables.Environment = getTCCommandLineParam(environment); } That TestComplete script will be the first thing that runs after the Powershell script runs and opens up TestExecute to run all of the tests in that Vortex project suite. Am I on the right track, or would I need to do something different to get that parameter and then use it in the TestComplete script?3.8KViews0likes9CommentsRe: How To Use Parameters To Change The URL
Thanks for the reply! I'm thinking the INI route may be the better way to go. Could you provide an example (or offer any additional insight) in the INI file? Specifically, the code that I would need to have in place to read the INI file and update the URL variable to the value in the INI file. Thanks!3.8KViews0likes1CommentHow To Use Parameters To Change The URL
We have a suite of tests that we kick off using a PowerShell script every time there's a product deploy. We have 2 environments where the tests run: A QA environment and a "live" environment. Currently, when we want to run the tests in one of the environments, we go to the project suite variables tab and change the URL variable for the project suite to the URL that we want to run the tests on right before we deploy to that environment. What we're trying to do now is set the tests up in a way so that every time there's a deploy to our QA environment or the "live" environment, the tests will automatically kick off in the environment that we deployed to without someone manually having to go into the project suite variables and changing the URL. I'm thinking that the best way to go about that is to pass in that project variable as a parameter somehow, but I have no idea how to go about doing that. I did a Google search and came across this video on the TestComplete support site, but the video never loaded or played for me: https://community.smartbear.com/t5/TestComplete-General-Discussions/Running-Test-Execute-file-from-powershell/td-p/126056 Any other ideas or suggestions on how we can get the tests to automatically run in the correct environment would be greatly appreciated.4.4KViews0likes16CommentsRe: Running TestExecute Using A PowerShell Script
Thanks everyone for all of the suggestions. I actually stumbled across the solution to my issue in this thread: https://community.smartbear.com/t5/TestComplete-General-Discussions/Running-Test-Execute-file-from-powershell/td-p/1260564.3KViews0likes1CommentRe: Running TestExecute Using A PowerShell Script
This is the PowerShell script that I'm trying to run: Powershell PS C:\Users\kevin.burdett> Start-Process cmdlet Start-Process at command pipeline position 1 Supply values for the following parameters: FilePath: PS C:\Users\kevin.burdett> Start-Process -FilePath “C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\TestEx ecute.exe” “X:\QA\Automated Testing\Vortex\Vortex.pjs” /r /p:Vortex”C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\ TestExecute.exe” “X:\QA\Automated Testing\Vortex\Vortex.pjs” /r /p:Vortex Start-Process : A positional parameter cannot be found that accepts argument ‘/r’. At line:1 char:1 + Start-Process -FilePath “C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\Tes ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand This doesn't work when I try to run it from PowerShell, but if I take that same file path and enter it into the Command Prompt, it will launch TestExecute and run all of the tests in our Vortex suite. I haven't been able to figure out why this works in the Command Prompt but not from a PowerShell script.4.4KViews0likes1Comment