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:
The Otii Automation Toolbox license is:
You can also configure a license pool that automatically shares the licenses among your automation setups. When using a shared pool, your test scripts can be configured to wait for a license to become available before execution.
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.
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 Desktop App.
If you run otii_server
with the --help
option you will see all available options:
# otii_server --help
Options:
-V, --version output the version number
-v, --verbose verbose output
-c, --config <config-file> configuration file
-h, --help display help for command
To start a server run the command:
# otii_server
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:
{
"tcpserver": {
"host": "127.0.0.1",
"port": 1907
},
"proxy": {
"host": "192.168.1.1",
"port": "8080",
"auth": {
"username": "johndoe",
"password": "mypassword"
}
}
}
and start the server with:
# otii_server --config config.json
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.
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:
#!/usr/bin/env python3
'''
If you want the script to login and reserve a license automatically
add a configuration file called credentials.json in the current folder
using the following format:
{
"username": "YOUR USERNAME",
"password": "YOUR PASSWORD"
}
Alternatively you can set the environment
variables OTII_USERNAME and OTII_PASSWORD.
'''
from otii_tcp_client import otii_client
def my_test(otii):
# INSERT TEST CODE HERE
def main() -> None:
# Connect and login to Otii 3
client = otii_client.OtiiClient()
with client.connect() as otii:
my_test(otii)
if __name__ == '__main__':
main()
The `client.connect() is used to connect, login and reserve licenses. It works like this:
credentials.json
file in the current directory, or from the environment variable OTIIUSERNAME and OTIIPASSWORD.client.connect(licenses = [ 'Automation', 'Battery' ])
#!/usr/bin/env python3
from otii_tcp_client import otii_client
# Connect and login to Otii 3
client = otii_client.OtiiClient()
with client.connect(licenses = []) as otii:
# List all licenses
licenses = otii.get_licenses()
for license in licenses:
items = [
f'{license["id"]:4d}',
f'{license["type"]:12}',
f'{license["reserved_to"]:15}',
f'{license["hostname"]}'
]
print(' '.join(items))
# Reserve a license
otii.reserve_license(licenses[0]["id"])
# INSERT TEST CODE HERE
# Return license
otii.return_license(licenses[0]["id"])
You can do the user management from the command line using our python module. You install the module with:
python3 -m pip install --upgrade otii_tcp_client
You can then use the otii_control tool for user management:
python3 -m otii_tcp_client.otii_control --help
usage: otii_control.py [-h] {login,logout,list-licenses,reserve-license,return-license} ...
Otii Control
options:
-h, --help show this help message and exit
commands:
{login,logout,list-licenses,reserve-license,return-license}
login Log in to Qoitech server
logout Log out from Qoitech server
list-licenses List all available licenses
reserve-license Reserve license
return-license Return license
And here is an example bash script:
#!/usr/bin/env bash
python3 -m otii_tcp_client.otii_control login --username johndoe --password mypassword
python3 -m otii_tcp_client.otii_control reserve-license --id 1234
./my_test.py
python3 -m otii_tcp_client.otii_control return-license --id 1234
python3 -m otii_tcp_client.otii_control logout