Forum Discussion

qmanuel's avatar
qmanuel
New Contributor
6 years ago

TestExecute, running without being logged in

I'm aware of this page. https://support.smartbear.com/testcomplete/docs/testing-with/running/on-locked-computers.html

However, as a part of a team discussion, I'd like to seek confirmation about whether it is possible to run TestExecute with a scheduled task without the computer being logged in at all. I'm pretty sure it still requires a login at some point just like the above method, but a confirmation would be nice. 

  • Hi,

     

    > whether it is possible to run TestExecute with a scheduled task without the computer being logged in at all.

    Yes, TestExecute (and TestComplete) can be started by the scheduled task and perform actions that do not require UI interactions. For example: access to file shares, sending/receiving http requests, working with COM objects, etc.

    Interaction with UI is not possible for this scenario. The reason is not in TestExecute/TestComplete, but in the fact that operating system does not provide user session with desktop to the tasks started unattended and thus GUI applications just has no place where display their user interface. And, subsequently, TestExecute/TestComplete cannot access user interface that does not exist.

     

  • Lagencie's avatar
    Lagencie
    Frequent Contributor

    we managed this with jenkins and there we do not need a user to be logged in when starting the TestExecute Test, only the machine must be reachable from jenkins.

     

    https://support.smartbear.com/testcomplete/docs/working-with/integration/jenkins/requirements-and-limitations.html

     

    Here are some requirements that are needed so it can actually run without logging in - perhaps some of those settings might also help when running TestExecute in a scheduled task

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    > whether it is possible to run TestExecute with a scheduled task without the computer being logged in at all.

    Yes, TestExecute (and TestComplete) can be started by the scheduled task and perform actions that do not require UI interactions. For example: access to file shares, sending/receiving http requests, working with COM objects, etc.

    Interaction with UI is not possible for this scenario. The reason is not in TestExecute/TestComplete, but in the fact that operating system does not provide user session with desktop to the tasks started unattended and thus GUI applications just has no place where display their user interface. And, subsequently, TestExecute/TestComplete cannot access user interface that does not exist.

     

    • qmanuel's avatar
      qmanuel
      New Contributor

      Sounds like what I expected.
      Good to know that it can be used for some non GUI tasks when not logged in but our main purpose involves a web site and interacting with the gui.

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        > a web site and interacting with the gui.

        This means that the following must be met:

        -- User logged-in interactively;

        -- Active not locked user session;

        -- Jenkins agent started not as a service (because service cannot interact with UI) but as an application from within this given user session (Jenkins agent has such option);

        -- TestComplete/TestExecute (and browser, depending on your test design) must be started by Jenkins agent to inherit its access to user session and its GUI.

         

        P.S. For the note: the above design is not something specific to TestComplete/TestExecute but the fundamental requirement of Windows OS.

         

    • Lagencie's avatar
      Lagencie
      Frequent Contributor

      Are you sure AlexKaras?

       

      We test our jenkins run with logged out user (fully UI tests).

       

      Watching on the monitor from the machine where our jenkins tests run you see a logged out user for the whole process. It starts a subprocess in the background and rund the UI tests there (not sure about the logic behind it and how its done).

       

      But we do not need a user to be logged in, nor do you visually see a test run.

       

      Support helped me to set up the jenkins to run with a non active user session

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Lagencie :

        > We test our jenkins run with logged out user (fully UI tests).

        In case of Selenium, headless web driver may be used. Interactive UI (might) not be required in this case.

        Also, because Selenium does not interact with the UI like the human user does but emulates this via API calls, it is possible to lock the desktop while Selenium tests are running. But active unlocked session is still required to start browser.

         

        In case of TestComplete:

        Can you describe your setup with more implementation details?

        It is quite possible, that UI for your user is switched to console. In this case the user will be displayed as disconnected in the remote desktop software.

        I also saw somewhere in time that technically it is possible to assign (or keep on disconnect/logoff) a video buffer to the user session. So it will have all functionality of the interactively logged-in user, but without actual desktop. But I really doubt that you have such tricky setup.

         

        BTW, aren't you running your TC tests on the server with the terminal services enabled?