Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Absent Member.. Prime2357 Absent Member..
Absent Member..
4527 views

Executing UFT Scripts on a remote machine

Jump to solution

I am attempting to execute UFT test cases on a remote machine but it only seems to work when I have an RDP connection open to the remote machine. If I have to open an RDP connection anyway, I might as well go ahead and kick them off directly on the machine.

We are tightly integrated with ALM/QC and I have my automated tests in a test set. I would like to open QC (on my laptop), navigate to the test set, Run Test Set, and enter the name of the remote machine (a dedicated "test runner" machine). This machine has both QC and UFT installed and options selected to "allow other HP product to run test".

Unfortunately I get errors saying it can't connect to the remote machine. If I first open an RDP session to this machine, it seems to work.

One of our goals is to have automated testers create the UFT tests and add them to the designated test set. Then non-technical users can kick them off from QC at will without needing to really know anything about UFT. We just would like to give them the name of the "test runner" machine to enter in the correct field and come back later to see the results. Having lots of manual testers RDP into the 'test runner' first is impractical for a variety of reasons.

Any help or suggestions would be appreciated.

0 Likes
1 Solution

Accepted Solutions
Established Member.. APGGroep
Established Member..

Re: Executing UFT Scripts on a remote machine

Jump to solution

We also have a lot of RDP clients, on which we schedule and run tests.

This is how we are doing it at the moment. We have several PC machines, which we connect to via RDP sessions. On all these we installed Caffeine.exe. Once installed and activated this simulates a keystroke preventing any screensavers to activate.

If you have a test scheduled on a RDP client you can close the connection to this RDP client is a specific way, so the RDP will not get in a lock mode.

Also we downloaded the Display Changer application (dc64.exe see https://communities.vmware.com/docs/DOC-16772).

Create a notepad file with following text:

*****************************************************************************************************************
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (%windir%\System32\tscon.exe %%s /dest:console)
*****************************************************************************************************************

After disconnecting the screenresolution of that RDP client will go to its default resolution. If you also need to make sure that after disconnection of the RDP client the screenresolution should be of some specifcic resolution for your test (if using Insight Objects in your tests, or Image checkpoints etc., where specific screen resoltion is important), you can download Display Changer application (dc64.exe see https://communities.vmware.com/docs/DOC-16772). And create the following BAt file (example with 1920 X 1200 resolution):

*****************************************************************************************************************
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (%windir%\System32\tscon.exe %%s /dest:console)
"C:\<path to dc64.exe>\dc64.exe" -width=1920 -height=1200 -depth=32
*****************************************************************************************************************


Save this file on the local RDP drive as RDPDisconnectSession.bat. Create a shortcut on your desktop and link to this .bat file.

Once you scheduled a test on that RDP, execute the created shortcut as Administrator. The RDP client will now be disconnected, but in such a way that your secheduled test will run, also on GUI actions.

BUT BE AWARE: in scripts were you used Insight Object recognition (image based thus) , it still could fail in some cases. But if you have scripts with no Inisght Objects identification, it will run fine. It works for us at the moment.

10 Replies
Ruddy_A_FT Outstanding Contributor.
Outstanding Contributor.

Re: Executing UFT Scripts on a remote machine

Jump to solution

Hi,

Hope you are doing well.

I was searching for information about this and in below link you may find UFT user guide which in page 702 explain how to:

Run A GUI Test with a disconnected Remote Desktop Connection

Relevant for: GUI Tests only This Task describes how to run a GUI Test after disconnecting an Remote Desktop Connection To a computer running UFT. This Enables you to start a test run and disconnect your computer from the UFT computer, enabling the test to run independently while you continue work on your own computer.

This docuement explain all the prerequisites and configuration you need to work with RDP.

Hope you will find well this information.

Regards,

” If you find this or any post useful to resolve the issue, please mark this thread as correct answer and other members can benefit with the information given”

 

 

Ruddy Alvarez H.
Customer Support Engineer

If you find thst aat this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the pond show your appreciation.
Absent Member.. JPMS_1 Absent Member..
Absent Member..

Re: Executing UFT Scripts on a remote machine

Jump to solution

Hi 

Hope you are doing well.    I would like to include some additional information to the RDP Execution while using UFT, maybe that helps to clarify what happens and how you can solve the issue using the intrusctions of the User Guide (Refers previoius post). 

Running a UFT script who fails or behaves unexpectedly while no RDP Connection is a known limitation causes by the Operating System.   When you Close and RDP Session, it automatically locks the machine and this action disables the GUI and some Windows messages, including mouse and the keyboard messages. Some UFT methods use these system messages to communicate and interact with the application under test and considering they are disabled by the Operating System, UFT will fail the test because is not possible to interact with the AUT.. 

Also, when running the testing tool (UFT) remotely from ALM/QC on a Terminal/Citrix server  (Including Windows Server Environments), there is no problem as long as the machine is logged in. However, if the user wants to run the script remotely from a ALM/QC client machine when there is no user logged to the machine, this is technically not possible to be done.

Due to a Microsoft design limitation, DCOM servers could be only run on the Operating System Session 0, which is the session of the console running on the server machine and only enabled when there is a user logged to the machine.

When the machine it’s locked or an RDP session it’s minimized/closed, the operating system have the same effect as you logoff the machine causing some features are disabled, some of them are required by/UFT and ALM/QC to perform any test execution:

  • Session 0 (affecting DCOM communication between ALM/QC and any testing tool)
  • UI windows messages (affecting QTP test execution).

For more information about this operating system limitations with Locked Machines or no user logged please refers to following articles

KM185060 - Can QuickTest Professional (QTP) or Unified Functional Testing (UFT) GUI scripts replay on a locked or logged off machine?

Thanks

 

 

 

Juan Pablo Muñoz
HPE Technical Account Manager

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
Ana_Noncheva Absent Member.
Absent Member.

Re: Executing UFT Scripts on a remote machine

Jump to solution

Hello,

Just as already explained above, in short, as far as UFT is concerned, the test needs to be started on a loggen-in machine. This is a limitation from UFT side. Yes, you, have the option in some cases to then minimize or even disconnect the RDP once the test is started (already described option Allow UFT to continue running GUI or business process tests after disconnection from an RDP computer), but initially the RDP machine needs to be logged-in in order to start the test.

I would like to add however the option to run tests stored in ALM using ALM Server-Side execution feature (i.e. Lab management) - this may suit your needs as it does NOT require to manually login/RDP connect to the machine in order to start the test. Basically, Server-side execution enables ALM to run UFT tests on remote hosts at predefined times or on an ad-hoc basis, without anyone logged in to the host to initiate and control the test runs. You will need to enable your ALM for Lab management first. For details regarding this option, please check UFT help documentation > Use the UFT IDE > UFT Integration With HP ALM > ALM Integration > Running Tests in Server-Side Execution. And, discuss it with your ALM administrator.

I hope this information helps!

Regards,

Ana

“HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.”
Established Member.. APGGroep
Established Member..

Re: Executing UFT Scripts on a remote machine

Jump to solution

We also have a lot of RDP clients, on which we schedule and run tests.

This is how we are doing it at the moment. We have several PC machines, which we connect to via RDP sessions. On all these we installed Caffeine.exe. Once installed and activated this simulates a keystroke preventing any screensavers to activate.

If you have a test scheduled on a RDP client you can close the connection to this RDP client is a specific way, so the RDP will not get in a lock mode.

Also we downloaded the Display Changer application (dc64.exe see https://communities.vmware.com/docs/DOC-16772).

Create a notepad file with following text:

*****************************************************************************************************************
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (%windir%\System32\tscon.exe %%s /dest:console)
*****************************************************************************************************************

After disconnecting the screenresolution of that RDP client will go to its default resolution. If you also need to make sure that after disconnection of the RDP client the screenresolution should be of some specifcic resolution for your test (if using Insight Objects in your tests, or Image checkpoints etc., where specific screen resoltion is important), you can download Display Changer application (dc64.exe see https://communities.vmware.com/docs/DOC-16772). And create the following BAt file (example with 1920 X 1200 resolution):

*****************************************************************************************************************
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (%windir%\System32\tscon.exe %%s /dest:console)
"C:\<path to dc64.exe>\dc64.exe" -width=1920 -height=1200 -depth=32
*****************************************************************************************************************


Save this file on the local RDP drive as RDPDisconnectSession.bat. Create a shortcut on your desktop and link to this .bat file.

Once you scheduled a test on that RDP, execute the created shortcut as Administrator. The RDP client will now be disconnected, but in such a way that your secheduled test will run, also on GUI actions.

BUT BE AWARE: in scripts were you used Insight Object recognition (image based thus) , it still could fail in some cases. But if you have scripts with no Inisght Objects identification, it will run fine. It works for us at the moment.

Absent Member.. Prime2357 Absent Member..
Absent Member..

Re: Executing UFT Scripts on a remote machine

Jump to solution

Thank you for the information, but I had previously found this resource. Thank for confirming I had been in the right place however!

0 Likes
Absent Member.. Prime2357 Absent Member..
Absent Member..

Re: Executing UFT Scripts on a remote machine

Jump to solution

Thank you for that additional information it does help me understand the problem. I have been able to use a similar feature with other products in the past, so I know there must be a way to overcome this limitation.

0 Likes
Absent Member.. Prime2357 Absent Member..
Absent Member..

Re: Executing UFT Scripts on a remote machine

Jump to solution

Thank you, Ana, for the information about Lab Manager. I had wondered if that would be a useful feature, but my company has decided to upgrade to QC Enterprise only, which does not have Lab Manager installed.

0 Likes
Absent Member.. Prime2357 Absent Member..
Absent Member..

Re: Executing UFT Scripts on a remote machine

Jump to solution

Thank you APGGroep, for your work around suggestion. I have not completely implemented it yet, but have done enough to validate that you are on the right track and I understand your explanation. Thank you so much for the help, I am marking your post as the solution.

0 Likes
ajitbhaskaran
New Member.

Re: Executing UFT Scripts on a remote machine

Jump to solution

Hi All,

We have implemented a solution of running HP UFT GUI tests without using a RDP connection.

Steps followed:

1. Provision a windows machine and install HP UFT & license using ansible scripts 

       a) Perform the registry settings for security and authentication (usually the default values work)

       b) Perform the registry settings for auto login for the user

       c) Perform machine reboot to trigger the auto login

       d) Create and trigger a windows stay awake script (may be using vbs, mostly available online)

2. Run a jenkins job with the node as Windows machine

      a) Load the test scripts into the windows machine

      b) Trigger the HP UFT test scripts using a bat file (sample scripts available in the HP website)

3. We can see the results from the jenkins workspace

4. We de-provision the windows machines after the test completion.

 

Note:

      a. Do not login to the windows user manually which might interrupt the test results.

      b. No need for GUI enablement within HP UFT

 

Let me know if you need more information, I am happy to help.!!

0 Likes
prateeksarda
Visitor.

Re: Executing UFT Scripts on a remote machine

Jump to solution

Hi Ajit,

We are trying to automate the setup of Windows machines to install UFT on them and thought of automating the process using Ansible.

Can you share any materials on the same as you mentioned you have done similar setup with ansible scripts.

Thanks

Prateek

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.