You can also start the TCP server using otii_server, the command line version of Otii.
The server is packaged within the application and to find where it is located on your system, select Help › Find otii_server in Otii 3.
If you run otii_server with the --help option you will see all available options:
To start a server run the command:
The server is by default listening on host address 127.0.0.1 and port 1905. If you want to change the default settings, or need to add settings for a proxy, create a config.json file:
and start the server with:
The server will run until you stop it by pressing Ctrl-C.
In a future release Otii will ship with tools that will make it possible to run otii_server as a Windows Service, or a daemon in Ubuntu and macOS.
It is possible to control Otii from another application using the Otii TCP Server API.
Using this API you can control Otii from any application that includes support for standard TCP sockets.
Otii server is available in both the Otii 3 Desktop App and in the Otii Server application. You can not run both at the same time on the same computer.
At Qoitech's Github page you will also find wrappers for a few popular languages like Python, C#, Java & Matlab.
Read more about logging in and reserving licenses in the Otii 3 Desktop App here:
It is possible to use the TCP-API directly in the test script for user management:
The client.connect()
is used to connect, login and reserve licenses. It works like this:
If the TCP server isn't already logged in, the credentials will be read from a credentials.json
file in the current directory, or from the environment variable OTII_USERNAME and OTII_PASSWORD.
If there is no Automation Toolbox license reserved and there is a license available, it will automatically be reserved.
By default the system will only try to reserve an Automation Toolbox license. If you need to reserve another Toolbox as well add all the licenses you need to the licenses
parameter:
When disconnecting from Otii all licenses that were implicitly reserved will be returned, and if the connect
method logged in to the system, it will log out again.
If you want to manually reserve a specific license, you use an empty array for the licenses
parameter:
You can do the user management from the command line using our python module. You install the module with:
You can then use the otii_control tool for user management:
And here is an example bash script:
All these features require an Automation Toolbox License.
Otii Automation Toolbox is a software license that elevates Otii software with scripting capabilities to automate measurements based on the project's needs.
This toolbox features:
Scripting in any language using the Otii TCP Server API
Packaged scripting modules available from Github for Python, C#, Java and Matlab
Otii Server, a headless server that easily can be integrated in test setups
If you have reserved an Automation Toolbox License the TCP-server is automatically started when you start the Otii dekstop application.
You can see the status of the TCP-server in the lower right corner of the application.
You now can control the application using an external script.