Using a license pool
You can easily setup a pool of licenses that are automatically shared between a group of test automation computers.
Create a shared account in the Qoitech User Management
In the User Management you should set up an account that will be shared between the automation computers. You then add any number of automation licenses to this account, either by moving them from another account, or by purchasing new ones.
The credentials to this account should be stored in a JSON-file with the following format:
{
"username": "SHARED ACCOUNT NAME",
"password": "SHARED ACCOUNT PASSWORD"
}
Prepare automation computers
On each automation computer you need:
Otii 3 running (either Otii 3 Desktop or Otii Server)
A copy of the credential file mentioned above
Setting up the test code
Since the license pool typically has fewer licenses than there are automation servers, you need to set up the code to wait for a license before running a test.
You need to specify the location for the JSON-file with the shared credentials
You need to specify how long the test script should wait to get a license from the license pool
from otii_tcp_client import otii_client
CREDENTIALS = './shared_credentials.json'
GET_LICENSE_TIMEOUT = 20 # Seconds
def my_test(otii: otii_client.OtiiClient) -> None:
# Run test...
def main() -> None:
client = otii_client.OtiiClient()
with client.connect(credentials=CREDENTAILS, try_for_seconds=GET_LICENSE_TIMEOUT) as otii:
my_test(otii)
if __name__ == '__main__':
main()
The client.connect
method will automatically try to login to the license server and reserve a license. If it fails to reserve a license within the time specified it will throw an exception.
After the test is run, the license will be returned, and the client will be logged out.
Last updated
Was this helpful?