TestEngine Command-Line Tool
Use the TestEngine command-line tool to administer TestEngine and run tests.
The tool is the testengine.js file that is not shipped with TestEngine. Download it by using the npm tool.
Requirements
To use the TestEngine command-line tool, you need to download and install node.js:
Install the TestEngine command-line tool
You install the command-line tool by using the npm
tool from the node installation:
npm install -g testengine-cli
After you execute this command, the testengine
command will be available in your terminal.
Connecting to TestEngine
The TestEngine command-line tool requires the address of the host to which it should connect and the credentials of a TestEngine user. You can specify them either in the command line, or in a configuration file.
Command-line parameters
Add the following parameters to your command line:
Parameter | Description |
---|---|
| The name of the user in TestEngine. |
| The user password. |
| The address ( |
For example:
testengine -u john.smith -p passwOrd -h http://localhost:8080 [other options] <command> <command parameters>
Configuration file
Create a text file containing the following JSON object:
where —
Parameter
Description
username
The name of the user in TestEngine.
password
The user password.
host
The address (
host:port
) of TestEngine to which you want to connect.Specify the path to the configuration file in the command line by using the
-c
argument. For example:testengine -c testengine.conf [other options] <command> <command parameters>
Command line options
These options configure the command-line tool.
testengine [options] <command> <command parameters>
Available commands
The command line must also contain a command to run and the desired parameters:
testengine [options] <command> <command parameters>
The command line tool provides the following commands:
Command | Description |
---|---|
Gets the TestEngine Audit Log. | |
Retrieves, cancels or removes test jobs. | |
Runs a test. | |
Adds, removes or modifies TestEngine users. |
auditlog
jobs
run
user
Exit codes
The command-line tool uses the following exit codes:
0 | The latest test job was run successfully. |
1 | There was an error: the test job failed, the project file was not valid, the command-line tool could not connect to TestEngine, or any other error occurred. |
To get the exit code from the command line, use the following command: