Forum Discussion

MarkG123's avatar
MarkG123
Occasional Contributor
5 months ago

Free an Offline Floating License Programmatically

We use TestExecute in our CI environment, with the on-Prem license server to handle our concurrent licenses.

We noticed that TestExecute is very reluctant to hand back licenses.  We assumed it would consume a license when a test run started and handed it back when it finished, so we get concurrency upto the number of smartbear floating licenses we purchased.  This doesn't seem to be the case.

How can we force the license return at the end of a test run, so other CI agents can consume them?

The only docs I found, they talk about a manual process, which is useless in an unattended CI environment.

Free an Offline Floating License | TestExecute Documentation

Thanks.

6 Replies

  • MarkG123's avatar
    MarkG123
    Occasional Contributor

    Probably should have mentioned, we are using SessionCreator to run things, and that doesn't have an /exit commandline param like TE does...

    • rraghvani's avatar
      rraghvani
      Icon for Champion Level 3 rankChampion Level 3

      TestExecute and SessionCreator should gracefully close, in order to free the license. Verify your TestExecute settings are correctly defined i.e. closes on exit (should not appear in the taskbar)

      • MarkG123's avatar
        MarkG123
        Occasional Contributor

        How can I check this?  Tests are run via SessionCreator.  There is no /exit commandline option for sessioncreator.

  • When using SessionCreator RunTest, it will launch TestExecute and wait for it to finish. After the test run ends, TestExecute normally releases the license. However, that release may be delayed or fail in some setups, particularly in virtual environments.

    Option A: 
    Consider adding a cleanup step in your test script that calls TestExecute.exe /Exit at the end.

    Option B:
    A a workaround, bounce the Sentinel LDK License Manager service at the end of each test run. That forces the license server to refresh its state and drop stale session entries. SmartBear provides a script example to automate this approach https://support.smartbear.com/testexecute-for-testleft/docs/licensing/key-based/index.html 

    Stop-Service -Name "Sentinel LDK License Manager"
    Start-Sleep -Seconds 3
    Start-Service -Name "Sentinel LDK License Manager"
    

    🤖 AI-assisted response referencing TestComplete docs

    💬 Found the answer helpful? Give it a Kudos by clicking Like!
    ✅ Got your issue resolved? Click Mark as Solution so others can find it quickly.