Forum Discussion

rhu's avatar
rhu
Contributor
7 months ago

Problems when runing automated tests on a virtual machine

When running  TestEceute or TestComplete test in avirtual machine via azure pipeline take care to set the following registy key to 0 (infinitive)
Local Security Policy\Local Policies\Security Otions\interactivelogon: Machine inactivity timout

If not your test will not work. E.g if set to 600 (seconds) and your first tets is working, then an other test starting e.g 15 min later will not work anymore.

See also
https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/interactive-logon-machine-inactivity-limit

5 Replies

  • jkrolczy's avatar
    jkrolczy
    Regular Contributor

    Please explain this issue in more detail.
    I am curious about what is happening here.

  • rhu's avatar
    rhu
    Contributor

    Our company is using TestComplete and Testexecute for automated tests. These test run without problems when recorded played back using a pc (without pipeline).
    Then we decided to go a step further and include TestComplete /TestExecute in an azure Pipeline. 
    So we set up a virtual Pc and installed TestExecute.
    On our normal Pcs (where we used TestComplee/TestExecute before) we followed the steps to incluce git and connected the testsuite to an azure pipelin we created before.

    On the virtual PC we set up a user with autologin as this is needed to run the automated tests.
    Then we connected the pipeline/agent on the virtual pc so that "when a task is found for the pipeline" these task will run on the virtual pc starting TestEcecute and doing the tests.
    If we now connect to the virtual machine  (with the user mentioned before via Remote Desktop connection) an watch the pipeline and there is a "todo" while we are watching the test on the virtual Pc were ok.
    after watching we always use the recommended disconnect batch to disconnect from the virtual machine.
    We then found out that if we are not watcing /logged in with the user on the virtual pc, the test always fail when the last login was more then 10 minutes ago (this was hard to find out as we did not think of a timeout).
    Afters some research we also found that there (at least on virtual Pcs)  is a registry key/group policy at:
    "Local Security Policy\Local Policies\Security Otions\interactivelogon" named
    "Machine inactivity timout" 
    This was set to 600 (seconds).
    We then set it to 0 (infinity) and now all test are runnig ok even if the las login is e.g 24h ago

      • rhu's avatar
        rhu
        Contributor

        I would recommend that you add to your documentation to check the registr key named "Machine inactivity timout"  at "Local Security Policy\Local Policies\Security Otions\interactivelogon"

         if problems with running on a virtual machine appear

    • jkrolczy's avatar
      jkrolczy
      Regular Contributor

      Thanks for explaining the scenario in more detail.
      I appreciate that and will check out my settings.