Forum Discussion

steventwerd's avatar
steventwerd
Occasional Contributor
4 years ago

Test runner exit code: -10 (Unable to create a user session)

Hi,

I am getting an error in Jenkins when trying to run/build a TestComplete project. See the full build logs including the error that appears below:

Started by user admin
Running as SYSTEM
Building on master in workspace C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\TestCompeleteCheck

[TestComplete] The test execution started (TestCompleteExampleTest).
[TestComplete] Found TestComplete/TestExecute installations:
	Type: TC, Version: 14.80.627.7, Path: "C:\Program Files (x86)\SmartBear\TestComplete 14\x64\bin\TestComplete.exe"
	Type: TELite, Version: 14.80.627.50, Path: "C:\Program Files (x86)\SmartBear\TestExecuteLite 14\x64\bin\TestExecuteLite.exe"
[TestComplete] Selected TestComplete/TestExecute installation:
	Type: TC, Version: 14.80.627.7, Path: "C:\Program Files (x86)\SmartBear\TestComplete 14\x64\bin\TestComplete.exe"
[TestComplete] Launching the test runner.
$ '"C:\Program Files (x86)\SmartBear\TestComplete 14\bin\TestCompleteService14.exe"' //LogonAndExecute //lDomain: "" //lName: "" //lPassword: ******** //lTimeout: "-1" //lUseActiveSession: "true" //lCommandLine: '""C:\Program Files (x86)\SmartBear\TestComplete 14\x64\bin\TestComplete.exe" C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\TestCompeleteCheck\TestCompleteExampleTest\TestCompleteExampleTest.pjs" /run /SilentMode /ForceConversion /ns /exit /ExportLog:C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\TestCompeleteCheck\1618931950146.tclogx /ExportLog:C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\TestCompeleteCheck\1618931950146.htmlx /ErrorLog:C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\TestCompeleteCheck\1618931950146.txt /JenkinsTCPluginVersion:2.6.2"'
[TestComplete] Test runner exit code: -10 (Unable to create a user session).
[TestComplete] [WARNING] Unable to find the log file "1618931950146.tclogx".
[TestComplete] [WARNING] Unable to find the log file "1618931950146.htmlx".
[TestComplete] [WARNING] Errors occurred during the test execution.
[TestComplete] Marking the build as UNSTABLE.
[TestComplete] [WARNING] Unable to publish test results (xml data is empty).
[TestComplete] The test execution finished (TestCompleteExampleTest).
Build step 'TestComplete Test' changed build result to UNSTABLE
Finished: UNSTABLE

I followed the documentation: https://support.smartbear.com/testcomplete/docs/working-with/integration/jenkins/running-tests.html to make the tests and also followed the documentation: https://support.smartbear.com/testcomplete/docs/working-with/integration/jenkins/requirements-and-limitations.html so I'm unsure as to where I went wrong.

 

  • vinniew's avatar
    vinniew
    4 years ago

    From the build config youll need to conifigure a user. 

     

    Add a user that will be used for the interactive session. (Credentials) 


    Whether thats a test user or your own AD user as long as its valid and has relevant permissions you should be good. 

     

    Try that and let me know how it works

     

    KR 

     

    Vinnie

  • Ok, just reporting that I did manage to get it working.  The issue was actually a corrupted x64 installation.  Couldn't do a clean uninstall either, so had to do it manually and copy over a clean install from another server, e.g. files, folders, registry settings, etc.  But it works now.

  • Hi steventwerd 

     

    Hope you are well. 

     

    Its hard to say as it could be a number of areas in your build. 

     

    The starting point would be the TC item. 


    Have you used the correct project file directory including the ".pjs" part? 

     

    From there is the project correctly specified or are you executing the entire suite? 

     

    In the TestComplete Build what is configured in the in the "Advanced" section? 

     

    Do you have the interactive session configured . 


    Is the user you have used configured correctly?

     

    Is there an active session configured? 

     

    Let me know and I can try to help further 🙂 

     

    KR 

     

    Vinnie

    • steventwerd's avatar
      steventwerd
      Occasional Contributor

      Hi Vinnie,

      When I run the command: TestComplete.exe "C:\Jenkins\TestCompleteExampleTest\TestCompleteExampleTest.pjs" /run

      in the command line the tests run and for the project suit file path I used the same path so I'm sure the directory is correct.

      I am executing the entire suit.

      In the advanced section I have:

      Test Runner: TestComplete

      Version: Latest

      Action on warnings: none

      Actions on Error: Mark as FAILED

      Use test timeout: Unchecked

      Run interactive user session (TestComplete/TestExecute 10.6 or later is required): Checked

      Credentials: None

      Use Active session: Checked

      Session screen resolution: 1280x1024

      Generate MHT log file: Unchecked

      Generate JUnit-style report: Checked

      The user I have used I can't say if I have done it correctly but I thought I had. ~I followed the steps in the documentation:

      1. On your Jenkins node, set the System properties > Remote > Remote Desktop option to:

        • In Windows 10 and Windows 8 – Allow remote connections to this computer.

        • In Windows 7 – Allow connections from computers running any version of Remote Desktop (less secure).

      2. Add a user account under which you will run tests on the node to the Remote Desktop Users group.

      3. Make sure that the user account has a non-empty password.

      For the user account I used the MyPCName\Steven, not sure what the last point about non-empty password meant though.

       

      Hope this helps.

      • vinniew's avatar
        vinniew
        Staff

        From the build config youll need to conifigure a user. 

         

        Add a user that will be used for the interactive session. (Credentials) 


        Whether thats a test user or your own AD user as long as its valid and has relevant permissions you should be good. 

         

        Try that and let me know how it works

         

        KR 

         

        Vinnie