Ask a Question

Jenkins and logging into PC

SOLVED
endorium
Frequent Contributor

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.

2 ACCEPTED SOLUTIONS

Accepted Solutions
AlexKaras
Community Hero

Re: Jenkins and logging into PC

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;

-- ...

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

shankar_r
Community Hero

Re: Jenkins and logging into PC

You have to flow the steps mentioned in the below section.

https://support.smartbear.com/testcomplete/docs/working-with/integration/jenkins/requirements-and-li...


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

View solution in original post

10 REPLIES 10
AlexKaras
Community Hero

Re: Jenkins and logging into PC

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;

-- ...

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

endorium
Frequent Contributor

Re: Jenkins and logging into PC

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.

shankar_r
Community Hero

Re: Jenkins and logging into PC

You have to flow the steps mentioned in the below section.

https://support.smartbear.com/testcomplete/docs/working-with/integration/jenkins/requirements-and-li...


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

View solution in original post

endorium
Frequent Contributor

Re: Jenkins and logging into PC

Thanks both for your help 🙂

cunderw
Community Hero

Re: Jenkins and logging into PC

What does your Test Complete step look like in your current jenkins config? There should be an option to use an interactive user session. 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
endorium
Frequent Contributor

Re: Jenkins and logging into PC

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
Community Hero

Re: Jenkins and logging into PC

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.

 


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

endorium
Frequent Contributor

Re: Jenkins and logging into PC

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

AlexKaras
Community Hero

Re: Jenkins and logging into PC

Hi,

 

> It only works if I am already logged in.

This is correct and as expected.

One more time: Active, interactive, not locked user session must exist before starting tests and tests must be started within this session.

How to provide such session is another question with different possible options. For example:

-- Configure test box to login automatically when turned on;

-- Login manually and do not lock session;

-- Use the remote administration means to login remotely.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: