TestComplete Command Line
I want to make the command for execution of TestComplete tests as generic as possible without any hardcoded path. I have below queries regarding the use of Command line interface for TestComplete test execution:
Queries regarding command line execution:
1) How to use Project.Path or Project.FileName to get the current machine's current project path in the Command line execution?
2) How to use aqDateTime.Now() for creating a folder with current date and time stamp to get the logs or reports organized in a single folder as per the execution run time and date?
I tried to use + to append the above functions' values to the command but it didn't worl. Below is the sample command that I used.
TestComplete.exe Project.FileName /r /t: Test1 /el: "C:\Users\test\Documents\TestResults\"+aqDateTime.Now()+"\Test1_Run1.html" /ErrorLog: "C:\Users\test\Documents\TestResults\"+aqDateTime.Now()+"\Test1_Run1_Errors.html" /es:"C:\Users\test\Documents\TestResults\"+aqDateTime.Now()+"\Test1_Run1_Summary.html"
Solved! Go to Solution.
Project.Filename, aqDateTime, etc.... are all objects/properties that are only present in the runtime execution of the project... they are not valid as part of the commandline as the project hasn't executed yet.
To do what you want, you'll need to use some other tool like PowerShell or some BASIC within a batch file or something to make your commandline more generic
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Thank you for the answer. I got it. I will use a .sh or .bat file to invoke the command line.
I have 1 another question. Is it possible to pass the parameters specific to a test through the command line? If yes, how do I pass it?
As per below screenshot, for running the below test I want to pass the parameter values of browserName and url as edge and www.mywebsite.com within the command line. How do I do it?
You can definitely pass in arguments from the command line:
There is section at the bottom that describes how to do so.
Click the Accept as Solution button if my answer has helped
Thanks for your response. I think you are refering to the section that talks about ParamStr and ParamCount
which is under Remarks.
I will try it out and in case I face issues, I will open a separate discussion.