Forum Discussion

endorium's avatar
endorium
Frequent Contributor
7 years ago

Jenkins and logging into PC

I have the Jenkins test complete plugin. It all works fine except when it tries to log into the PC it runs Test complete on.

If I log into this PC and leave it unlocked the job passes fine when the jenkins agent runs.

 

If I am not logged in no matter how I configure the plugin the job fails as it cannot create a session. Any ideas as from a security aspect I cannot leave machines logged in and unlocked.

  • Hi,

     

    You *must* be logged-in with not locked desktop in order your tested application can display its GUI that TestComplete can interact with.

    The above is not TestComplete's requirement but basic behavior of the Windows OS.

    It is a matter of your permissions how to implement the above requirement and there are a lot of options possible:

    -- If you are a local admin for the test machine, you may remotely set it to automatically log in as some user, reboot it remotely, wait until it reboots and logs in, remotely start tests, wait until tests finish and log out;

    -- Use test machines that do not have monitors and accessed only via remote desktop (with the permission to connect granted only to certain accounts);

    -- Use virtual machines;

    -- Physically put test machines into restricted access area;

    -- ...

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    You *must* be logged-in with not locked desktop in order your tested application can display its GUI that TestComplete can interact with.

    The above is not TestComplete's requirement but basic behavior of the Windows OS.

    It is a matter of your permissions how to implement the above requirement and there are a lot of options possible:

    -- If you are a local admin for the test machine, you may remotely set it to automatically log in as some user, reboot it remotely, wait until it reboots and logs in, remotely start tests, wait until tests finish and log out;

    -- Use test machines that do not have monitors and accessed only via remote desktop (with the permission to connect granted only to certain accounts);

    -- Use virtual machines;

    -- Physically put test machines into restricted access area;

    -- ...

    • endorium's avatar
      endorium
      Frequent Contributor

      Thank you.

      How would I go about this option as I am admin on that machine:

       

      "If you are a local admin for the test machine, you may remotely set it to automatically log in as some user, reboot it remotely, wait until it reboots and logs in, remotely start tests, wait until tests finish and log out;"

       

      Is this done through the same Jenkins as well I presume?  Sorry for questions as have struggled to find anything. Even a steer in right direction would be appreciated.

    • samfozz's avatar
      samfozz
      Frequent Visitor

      The confusing thing about this is that the Jenkins plugin has a  "Use active session" option, Which would seem to imply that I have the option to not use the currrenlty logged in session? - All the advice on this forum implies that you must be logged in and the only working examples have that option checked though :/ 

  • endorium's avatar
    endorium
    Frequent Contributor

    I have interactive session enabled. Everything configured as per thread above.

    When I run the job through jenkins I get:

     

    02:02:36 [TestComplete] The test execution started (EnterpriseAutomatedTests/RegressionTests/NGSInstall/NGS01_01_01_Install_NGS).
    02:02:36 [TestComplete] Found TestComplete/TestExecute installations:
    02:02:36 	Type: TC, Version: 12.42.3048.7, Path: "C:\Program Files (x86)\SmartBear\TestComplete 12\x64\bin\TestComplete.exe"
    02:02:36 [TestComplete] Selected TestComplete/TestExecute installation:
    02:02:36 	Type: TC, Version: 12.42.3048.7, Path: "C:\Program Files (x86)\SmartBear\TestComplete 12\x64\bin\TestComplete.exe"
    02:02:36 [TestComplete] Launching the test runner.
    02:02:36 $ '"C:\Program Files (x86)\SmartBear\TestComplete 12\bin\TestCompleteService12.exe"' //LogonAndExecute //lDomain: "intern" //lName: "snejad" //lPassword: ******** //lTimeout: "-1" //lUseActiveSession: "true" //lCommandLine: '""C:\Program Files (x86)\SmartBear\TestComplete 12\x64\bin\TestComplete.exe" C:\Sandbox\AutomatedTests\EnterpriseAutomatedTests\EnterpriseAutomatedTests.pjs /run /SilentMode /ForceConversion /ns /exit /ExportLog:C:\Jenkins\TestNode1\workspace\TestNode1_Deploy\6156323.tclogx /ExportLog:C:\Jenkins\TestNode1\workspace\TestNode1_Deploy\6156323.htmlx /ErrorLog:C:\Jenkins\TestNode1\workspace\TestNode1_Deploy\6156323.txt /ExportLog:C:\Jenkins\TestNode1\workspace\TestNode1_Deploy\6156323.mht /project:RegressionTests /unit:NGSInstall /routine:NGS01_01_01_Install_NGS"'
    02:04:36 [TestComplete] Test runner exit code: -10 (Unable to create a user session).
    02:04:36 [TestComplete] [WARNING] Unable to find the log file "6156323.tclogx".
    02:04:36 [TestComplete] [WARNING] Unable to find the log file "6156323.htmlx".
    02:04:36 [TestComplete] [WARNING] Unable to find the log file "6156323.mht".

     

    • shankar_r's avatar
      shankar_r
      Community Hero

      Possible causes:

      • You might have active RDP connection of that VM in your local.
      • Double check the credentials
      •  Make sure you configured this topic correctly.

       

      • endorium's avatar
        endorium
        Frequent Contributor

        Checked all  of that and its fine.

         

        It only works if I am already logged in. If noone is logged in it fails with the above error