Forum Discussion

Shehnaz's avatar
Shehnaz
Occasional Contributor
5 years ago

Unable to create a user session - Error in Jenkins

I am trying to run Test Complete projects as a Freestyle Project on Windows server using Jenkins that is installed on the same sever.

Getting below Jenkins error –

 

Console Output

Started by user Shehnaz Patanwala

Running as SYSTEM

Building in workspace C:\Program Files (x86)\Jenkins\workspace\Test Complete

 

[TestComplete] The test execution started (PITA_Internal/C:\Users\Public\Install\pita-ui-automation-projects\PITA_Internal\A-Account_Reset_Project\A-Account_Reset_Project.mds).

[TestComplete] Found TestComplete/TestExecute installations:

        Type: TE, Version: 14.10.1042.11, Path: "C:\Program Files (x86)\SmartBear\TestExecute 14\x64\bin\TestExecute.exe"

[TestComplete] Selected TestComplete/TestExecute installation:

        Type: TE, Version: 14.10.1042.11, Path: "C:\Program Files (x86)\SmartBear\TestExecute 14\x64\bin\TestExecute.exe"

[TestComplete] Launching the test runner.

$ '"C:\Program Files (x86)\SmartBear\TestExecute 14\bin\TestCompleteService14.exe"' //LogonAndExecute //lDomain: "" //lName: "" //lPassword: ******** //lTimeout: "-1" //lUseActiveSession: "true" //lCommandLine: '""C:\Program Files (x86)\SmartBear\TestExecute 14\x64\bin\TestExecute.exe" C:\Users\Public\Install\pita-ui-automation-projects\PITA_Internal\PITA_Internal.pjs /run /SilentMode /ForceConversion /ns /exit "/ExportLog:C:\Program Files (x86)\Jenkins\workspace\Test Complete\1571766356292.tclogx" "/ExportLog:C:\Program Files (x86)\Jenkins\workspace\Test Complete\1571766356292.htmlx" "/ErrorLog:C:\Program Files (x86)\Jenkins\workspace\Test Complete\1571766356292.txt" /project:C:\Users\Public\Install\pita-ui-automation-projects\PITA_Internal\A-Account_Reset_Project\A-Account_Reset_Project.mds /DoNotShowLog /JenkinsTCPluginVersion:2.3"'

[TestComplete] Test runner exit code: -10 (Unable to create a user session).

[TestComplete] [WARNING] Unable to find the log file "1571766356292.tclogx".

[TestComplete] [WARNING] Unable to find the log file "1571766356292.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 (PITA_Internal/C:\Users\Public\Install\pita-ui-automation-projects\PITA_Internal\A-Account_Reset_Project\A-Account_Reset_Project.mds).

Build step 'TestComplete Test' changed build result to UNSTABLE

Finished: UNSTABLE

 

 

Looks like it’s failing because of not creating a User Session. I have configured my workstation accordingly. Only thing that's missing in Jenkin step is creating a node and cofiguring Jenkins slave agent runs as a service. 

Is this a required step to run freestyle job on the server locally?

  • Wamboo's avatar
    Wamboo
    Community Hero

    Hi,


    Yesterday i had the same error working with Jenkins and we notice that we needed to configure Jenkins slave exactly on the user You are trying to use with Jenkins slave service.


    So, did you configure the Jenkins slave on the user which You are trying to use with Jenkins?

     

    Ore there is a few configure checboxes to set up before run slave job, like "use active session" etc.

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Thanks for your suggestions, AlexKaras, Wamboo.

     

    Shehnaz, do the suggestions help you resolve the issue?

     

     

     

     

     
    • Nikolayev's avatar
      Nikolayev
      Contributor


      Hi Shehnaz 

      I have the same Error message.

      I didn't find answer on community so I recently open a case to the smartbear Support Team.


      Our Jenkins Master is based on another server, that seems to be the only difference with you issue.

       

      My Agent si installed as a service
      His name is : jenkinsslave-G__jenkins_workspace

      The windows service is set to run as "local service account" with "allow service to interact with desktop" checked.

      I launch my tests and I have the Jenkins message ending with :

      [TestComplete] Test runner exit code: -10 (Unable to create a user session).
      ... [TestComplete] Marking the build as FAILED.

       

      Did you find a solution ?

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        service is set to run as "local service account" with "allow service to interact with desktop" checked.

        To my knowledge, this setting allows service to display message boxes visible on the current desktop, but does not make service capable to create interactive user session.

        The best solution (if not the only possible one) is to set Jenkins slave to run as an application within the user session. (Yes, you must ensure session's existence first.)

         

  • ...  Shehnaz    Ho   ..  I see that after my first answer : the user name is empy in your Jenkins Job   "  /lName: "" . Maybe you remove  it voluntarily ?