Forum Discussion

kzumbusch's avatar
kzumbusch
Occasional Contributor
10 years ago

Run TestExecute or TestComplete from Windows service

Hi there,

 

we recently aquired TestComplete for automated setup, UI and web testing. These tests are run multiple times on different virtual machines on every operating system our application supports. My task is to include these automated tests into our existing build environment managed by VSoft Continua CI (https://www.finalbuilder.com/continua-ci).

 

Using Continua CI agents I can distribute all build related tasks to multiple computers and one of these computers will be our main TestComplete host. The Continua CI agents are Windows services executed with the identity of a Windows Active Directory user account. As one of the support documents about Jenkins integration states that TestExecute needs an active desktop enviroment I'd like to know if it's even possible to run our TestComplete project from a Windows service.

 

Kind regards

 

Kay Zumbusch

  • Hi Kay,

     

    Yes, I think that this should work. The only requirement here is that the correct user must be logged-in and have desktop session for the RDP computers.

    I am not sure if the project started as a slave from the master one in the Network Suite will open user session on the slave computer and use it then or not.

    If it is not, then you may consider the free RDP Plus utility that can be provided with (encrypted) user credentials to open the RDP session and then use, say, psexec utility by SysInternals (part of MS now) to start TestComplete remotely within opened user session. (You may even not to use the Network Suite in this case, but code the above two actions in the code started by Windows service.)
    http://community.smartbear.com/t5/Getting-Started-with/Does-TestComplete-Truly-run-Headless-TestExecute-as-well/m-p/93900 might appear to be useful (if you hadn't already read it)

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Kay,

     

    Yes, it is perfectly possible to start TestComplete/TestExecute from the Windows service and execute tests that do not require interaction with the user interface (e.g. WebServices can be tested without any problem).

    The story is different if you need to run tests against the GUI application and the problem here is not with TestComplete, but with the fundamental OS behavior when the user interface is not created when the user, TestComplete and the tested application are started on behalf of, is not logged on interactively. In this case the tested application starts, but has no desktop where to draw its UI and TestComplete's tests fail consequently because test code fails to find the non-existing UI controls.

     

    Solution: both, TestComplete and the tested application must be started on behalf of the user that logged-in interactively and has a desktop where the tested application can draw its UI.

     

    http://support.smartbear.com/viewarticle/55606/ and http://support.smartbear.com/viewarticle/56550/ might provide you with more information and ideas.

    • kzumbusch's avatar
      kzumbusch
      Occasional Contributor

      Hi,

       

      after studying the documentation on distributed testing I'd like to know if the following idea would work.

       

      We will create two test projects:

      - master project has just NetworkSuite configured

        - 15 virtual machines at the moment

        - logon set to "Automatic (RDP)"

      - slave project has all UI tests

       

      The master project is started from our Windows Service without any form of desktop environment using TestExecute command line. That should trigger the execution of the slave projects on all test environments registered with the NetworkSuite. The execution of the slave projects is executed sequentially if possible in order to keep license costs to a minimum. Time und utilization is not so important for our automated tests but 15+ floating TestExecute license is completely out of reach.

       

      As the master and the slave projects are executed by TestExecute on virtual machines we will have to purchase a second floating license for TestExecute.

       

      The main questions here are:

      Is it possible to run the master project without a desktop enviroment?

      Will the RDP connection to the slave nodes work?

       

      Kind regards

       

      Kay Zumbusch

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi Kay,

         

        Yes, I think that this should work. The only requirement here is that the correct user must be logged-in and have desktop session for the RDP computers.

        I am not sure if the project started as a slave from the master one in the Network Suite will open user session on the slave computer and use it then or not.

        If it is not, then you may consider the free RDP Plus utility that can be provided with (encrypted) user credentials to open the RDP session and then use, say, psexec utility by SysInternals (part of MS now) to start TestComplete remotely within opened user session. (You may even not to use the Network Suite in this case, but code the above two actions in the code started by Windows service.)
        http://community.smartbear.com/t5/Getting-Started-with/Does-TestComplete-Truly-run-Headless-TestExecute-as-well/m-p/93900 might appear to be useful (if you hadn't already read it)