TestComplete Command Line

6
38

Command Line Interfaces are often preferred by many users, as they provide a more concise and powerful means to control a system or application. Also the applications with command-line interfaces are often much easier to automate via scripting.

command-line copy

A command-line interface (CLI) is a means of interaction with a computer program where the user (or client) issues commands to a program in the form of successive lines of text (command lines).

Automating TestComplete becomes very easy via its Command-line interface. This is very simple and below are the ways to run it

file_name : Launches TestComplete and loads the specified project

/run (/r) – Commands TestComplete to execute tests provided by the project specified by the file_name argument.

/project (/p):project_name – Project_name is the name of the project. This will execute only those test items that are selected on the Test Items page. The unselected items are not run.

 

TestComplete will run test(s) provided by the specified project item. Project_name specifies the name of the project that holds the desired project item (use the same name as the name shown in the Project Explorer panel). Item_name is the name of the desired project item. only those project items that have the Run item in their context menu can be run in this case.

Note : Test items are those which are displayed on the Test Items page of the project editor. Project items are project elements that are shown in the Project Explorer panel.

 

TestComplete will run the specified test. This can be any element that TestComplete can execute: a keyword test, a script routine, a low-level procedure, a manual test, a network suite, and so on.

Test_name is the full name of the needed test. The full name of a test includes the test name, the name of the parent project item and, for scripts, the name of the unit, which are separated by the pipe character ( | ) and enclosed in quotation marks. For example, “KeywordTests|Test1”, “LLCollection1|LLP1” or “Script|Unit1|Main”.

 

TestComplete will run the specified script routine. Project_name specifies the name of the project to which the routine belongs. Unit_name specifies the name of the unit holding the desired routine. Routine_name is the name of the script routine to be called. The routine to be called must not use parameters or return any values. Project_name and unit_name should be the same as the project and unit names shown in the Project Explorer.

No /project, /unit or /routine arguments specified. TestComplete will run the tests provided by the opened project suite.

 

/exit ( /e) – TestComplete will close after the project (or project suite) run is over, should be used with /run argument.

This will execute all the projects that are enabled, waits until the execution is over and then TestComplete gets closed.

/SilentMode – If this argument is specified, TestComplete works in Silent mode, that is, it neither displays dialogs, nor informs you about errors or warnings.

/exportlog:File_name (or /el:File_name) – Exports the test run results to the .mht file specified by the File_name parameter.

/ForceConversion – If this argument is specified and TestComplete is running in Silent mode, TestComplete automatically converts projects created in earlier versions of the tool to the new format when they are opened.

/ns – Opens TestComplete without displaying the splash screen.

6 COMMENTS

  1. can i pass complete project path here “TestComplete.exe file_name /run /project:project_name /projectitem:item_name” because by projects are stored in a seperate folder in the project suite

    • You will need to read the files in the folder, check for the ‘pjs’ files and use any of the option above to execute in TestComplete. below is the code snippet you can use in VBS to read the files

      hope this is what you are looking for, if not please elaborate.

  2. […] TestComplete is also a COM Server and its different methods and properties are exposed by its COM interface which can be accessed by other applications and scripting tools to control it from outside. In this post, we will see how to interact with TestComplete from outside via COM. However there are other ways as well to interact with TestComplete, which we will discuss in another post for TestComplete : Command Line. […]

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.