Ask a Question

Unable to run TestComplete on Jenkins node

SOLVED
allenj2020
Contributor

Unable to run TestComplete on Jenkins node

Hello all,

 

I have a Helpdesk request open for this already, but figured I would try the forums also.

I am trying to run TestComplete on Jenkins for the first time, to migrate our previous NetworkSuite tests for parallel execution using Pipeline execution.

I have a master machine running TestComplete and the Jenkins master, and a node machine running TestExecute and the Jenkins node.  The master machine is logged in as a domain user, and the node machine is logged in and running unlocked with a different domain user, with the Jenkins node running as a service under that same domain user.

When I try to run 'Build Now' on my Pipeline, I see two problems:

1. TestComplete is found and started on the master machine, even though the agent is definitely running on the node.

2. I get an 'Unable to create a user session' error.

 

The node machine is unlocked, and TestExecute is running on it.

 

I have gone over the various TestComplete and Jenkins set up pages multiple times, and the following thread which has a similar error but different setup, and I'm still stumped.

https://community.smartbear.com/t5/TestComplete-General-Discussions/Unable-to-create-a-user-session-...

 

Here's my pipeline, which is configured to run a very simple project that I have confirmed can run successfully on the node machine:

pipeline {
  agent none
  stages {
    stage('Run test') {
      agent {
      label 'MyTestNode'
      }
      steps {
        echo "${env.NODE_NAME}"
        testcompletetest credentialsId: '',
        launchType: 'lcProject',
        project: 'inSight_INQ_SFA_OE',
        suite: 'D:\\inSight_HEAD\\Testing\\Projects\\inSight\\inSight.pjs',
        useTCService: true
      }
    }
  }
}

 

 

Log:

Started by user admin
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline[Pipeline] stage[Pipeline] { (Run test)[Pipeline] nodeRunning on VSIC112 in D:\inSight_HEAD\Testing\workspace\TestComplete inSight Desktop[Pipeline] {[Pipeline] echoStart TestComplete project inSight_INQ_SFA_OE[Pipeline] echoVSIC112[Pipeline] testcompletetest[TestComplete] The test execution started (inSight/inSight_INQ_SFA_OE).
[TestComplete] Found TestComplete/TestExecute installations:
	Type: TC, Version: 14.81.217.7, Path: "C:\Program Files (x86)\SmartBear\TestComplete 14\x64\bin\TestComplete.exe"
	Type: TELite, Version: 14.81.217.50, Path: "C:\Program Files (x86)\SmartBear\TestExecuteLite 14\x64\bin\TestExecuteLite.exe"
[TestComplete] Selected TestComplete/TestExecute installation:
	Type: TC, Version: 14.81.217.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" D:\inSight_HEAD\Testing\Projects\inSight\inSight.pjs /run /SilentMode /ForceConversion /ns /exit "/ExportLog:D:\inSight_HEAD\Testing\workspace\TestComplete inSight Desktop\1621525595237.tclogx" "/ExportLog:D:\inSight_HEAD\Testing\workspace\TestComplete inSight Desktop\1621525595237.htmlx" "/ErrorLog:D:\inSight_HEAD\Testing\workspace\TestComplete inSight Desktop\1621525595237.txt" /project:inSight_INQ_SFA_OE /JenkinsTCPluginVersion:2.6.2"'
[TestComplete] Test runner exit code: -10 (Unable to create a user session).
[TestComplete] [WARNING] Unable to find the log file "1621525595237.tclogx".
[TestComplete] [WARNING] Unable to find the log file "1621525595237.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 (inSight/inSight_INQ_SFA_OE).[Pipeline] }[Pipeline] // node[Pipeline] }[Pipeline] // stage[Pipeline] End of PipelineFinished: UNSTABLE

 

Thanks.

Allen

1 ACCEPTED SOLUTION

Accepted Solutions
sonya_m
Community Manager

Re: Unable to run TestComplete on Jenkins node

Hi @allenj2020 ! I found your support case, let me post the solution here so that anyone who's encountering a similar issue can see it:

 

>>

the pipeline was missing the userName and userPassword parameters to connect to the proper user session. Once we added them, we ran the test and were able to run correctly this time. 

<<


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

2 REPLIES 2
sonya_m
Community Manager

Re: Unable to run TestComplete on Jenkins node

Hi @allenj2020 ! I found your support case, let me post the solution here so that anyone who's encountering a similar issue can see it:

 

>>

the pipeline was missing the userName and userPassword parameters to connect to the proper user session. Once we added them, we ran the test and were able to run correctly this time. 

<<


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

allenj2020
Contributor

Re: Unable to run TestComplete on Jenkins node

Hello all,

 

After some further troubleshooting and a call with support I got this working, and wanted to provide more detail.

 

Issue 1: This was a configuration issue finding TestComplete on the 'wrong' machine.  It turned out someone installed and ran a service on the host machine with the same name as the agent machine.  Removing that service and properly configuring a service agent on the agent machine got this resolved.

 

Issue 2: 

If the agent was running as a service on the agent machine with user "Local service", it gave 'Unable to create a user session' error.

If the agent was running as a service on the agent machine with the domain user, it tries to launch the test runner and hangs forever.

 

The final resolution to this was to:

1. Have the agent running as a service on the agent machine with user "Local service"

2. Have the pipeline configured with userName and userPassword, not credentialsId

 

Final syntax:

testcompletetest userName: '[domain\\user]',
userPassword: '[domain user password]',
launchType: 'lcProject',
project: 'inSight_INQ_SFA_OE',
suite: 'D:\\inSight_HEAD\\Testing\\Projects\\inSight\\inSight.pjs',
useTCService: true,
useActiveSession: true

cancel
Showing results for 
Search instead for 
Did you mean: