Getting 'HPE Unified functional testing computer is locked or Logged Off 'message - hp-uft

I am facing below issues while executing the scripts from ALM. There are 5 scripts for execution & execution got stopped after 1st script, due to which status of rest scripts is ‘Not Completed’.
Reason for not completed script is “General Error. The HPE Unified functional testing computer is locked or Logged Off” .
While putting the script for night execution, we always run the screen unlock vbs script which do not lock the machine[ Local & RDP] & this unlock script is working as expected but still we are getting this error.
NOTE:
1] We work on Remote Desktop Machine where UFT & ALM is installed. Local machine is only to launch the RDP.
2] ALM remain logged in for entire night due to ALM execution scheduler.
Refer attached error screen shot for more details

Within regedit go to:
HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest
With MicTest highlighted you will see many registry settings. Scroll down the list until you get to SkipEnvironmentChecks.
Change the value of this registry setting to 1 (from 0).
This will cause QTP to not check for the system being locked and will instead kick off your test. However, if the machine is logged off, it will not help. So make sure that the machine you want to run the script on is locked and not logged off and you should be fine.

Related

Using GitLabRunner to execute GUI tests on windows with permanent active user session

i'm having issues to get a permanent active user-session on my virtual machine to execute gui tests developed with the functional testing tool Ranorex Studio via GitLab-Runner (Windows / Shell). The testsuite is based on a .NET solution which is built via MSBuild.exe and the output (bin/debug/*.exe) will be executed with some parameters via command line.
Procedure:
Start gitlab-runner via PowerShell as administrator with "gitlab-runner run" command
Make some changes in GitLab-Repository to start the pipeline via .yml-File
Ranorex test-project is built successfully and is starting the GUI-tests
In the first run the user session is active and the tests are going to be executed and interacting with the GUI, but when i try to trigger the pipeline again for further runs, the user-session turns to false and there is no interaction with the GUI (black sceenshots in test-report).
Already did:
Screensaver disabled
StandBy-Mode disabled
User-Access-Control on lowest setting
Lock-Screen disabled
Secure-Login disabeld
Remote connections enabeld
Ports openend
Keep Session open via .batch-File, when closing RDP-connection
GitLab-Runner Service => Log on with respective AD-User (equipped with admin-rights)
AD-User is alway logged in on virtual machine
With Jenkins (Master / Slave configuration) everything works fine
Would be grateful for any help!
Does your Ranorex process close down properly with an exit code? Does the Application Under Test also close down properly at the end? I am assuming something has locked - you could try a bit of Powershell to close the processes before a test run. One thing I had to do was keep the screen on - using a utility like 'Caffeine'.

UFT script pause when closing Remote Desktop

Im launching an UFT script in a Remote machine. The access to that Remote machine es from my Local machine (the script is launched in the Remote, not from local).
The problem is that if I close the Remote Desktop, the script pauses until I start another time the machine.
How can the script continue with the Remote Desktop closed? I tried going in UFT to Tools -> Options -> Run session -> allow scripting when RDP is closed and entering user and pass with a verified conection, but does not work.
Thanx!
More of a workaround. Have not seen this flag working for some time, but that could just be inexperience.
Alternatives are:
Configure a service account that logs in and starts UFT Run time as soon as the server is started.
Stay logged into the remote session and disable auto screen lock.
Use mouse move tools like MouseJiggle to stop the screen locking
UFT documentation give several places where settings must be configured. (during installation, post installation)

Reporting status back to TeamCity when a test is ran locally

We have a testing framework made in AutoIt for our Windows apps (older legacy apps that we will continue supporting). These have never been run on a schedule or part of CI (always been run manually). I tried to get some kind of auto run (or even just status reporting) out of the tests, with minimal luck.
I have a VM where the tests can run. I experimented with my own web app, which works okay locally for running and status reporting. But when set up on the server, AutoIt reports it cannot open the application. Same thing happens if I try to run the tests from a .bat file.
My current solution is to have AutoIt call my web app to report status (working okay locally, untested on the server), or to see if I can get AutoIt to report results back to TeamCity. I have the agent installed but when I run the build from TeamCity, AutoIt reports it can't launch the application. I tried this while logged into the VM, logged out, with RDS open; no luck.
Is it possible to run the tests manually from the VM and send results back to TeamCity? When I run them from TeamCity it reads the AutoIt output (which is in the expected format), but I need to let TeamCity know to update the results (so we can use TeamCity rather than my web app to show the results).
I may need to find a way to let TeamCity know a build has been started, which might then let it know to keep an eye on the process' output, but I'm not positive. Any ideas?
I solved this so it could be done more traditionally.
If anyone is confused by what "running the agent from the console" meant, it just means installing the agent without selecting the "as a service" checkbox, and then manually starting the agent by cd'ing to the BuildAgent/bin directory and running the command agent start. I also created a batch file that will do this automatically (but you must run it as admin).
Further, I found AutoIt couldn't do anything if the test doesn't run from the right directory, so I had to devise a solution to this.
The only issue now is that I have to have an old laptop always connected to the virtual machine the tests and app run on (since the AutoIt tests won't work without the VM desktop being interactive).

Automation: How to run some program on multiple windows 7 PCs?

I have an program which I need to run on multiple PCs (>100) all in same domain and share the same user and password.
If I run a program manually, it opens a console windows where I can see the logs running. I can remote desktop and still be able to see the console windows open and logs running. It helps in debugging as I can see whats going on. Issue is I want to avoid running it manually on all PCs.
I have following requirement
a. It should be able to run program on multiple pcs remotely
b. program should open in foreground where console logs can be seen.
c. launching PC should launch program on PC1 and then (without wait for the program to finish on PC1) it should launch the program on PC2 and so on.
I explored STAF it needs to be installed on all stations. Its heavyweight, needs complex configuration.
I explored power shell , it needs to be enabled on all stations and also probably (read somewhere) has issue with running tasks in foreground.
psexec can run the program but it does it in background, if I use -i option I need to give session id so only it will show the console for a specific remote desktop session. Another major issue with -i is that it will interactive so it waits until the program exits.
Looked a paexe, its simillar to psexe and doesn't solve the issue I am facing with psexe.
Any help is greatly appreciated.
If you have a server, you can put the program on the server and create a shortcut to it (assuming the program is small/simple enough to run on a network share).
You can use One-Click to deploy the programs, and give each of your users a link.
You can change the program into a website for central access.
You can use group policy to deploy the program when a user logs in, assuming you can create a .msi file from it.

Facing "The 'My application' window is invisible and cannot be activated" error when executing TestExecute through teamcity

Background:
With TestComplete 6 we have created a project which clicks few buttons in our application and performs few tasks. To automate it we have created a .bat file which installs our application (desktop) executes testexecute.exe in silentmode and uninstalls the application. This .bat file works fine when we execute it locally.
But when we execute this .bat file on a remote machine (teamcity agent) through teamcity I get "The 'My application' window is invisible and cannot be activated" error. Any UI action I try to execute fails because my application window in visible. It works fine till installing and starting my application, but once the application is started it can't execute any GUI task.
This weird behavior raised few doubts.
Why testexecute is unable to interact with the GUI?
Does the user account which teamcity uses to run testexecute.exe need special privileges on that machine?
How to execute TestExecute.exe on a remote machine and what things I need to take care of while doing it?
The TeamCity agent works as a system service which does not have access to GUI. This means that all processes invoked by it do not have access to GUI as well.
You can check the 'Run interactive' box for the agent service in the Services snap-in. However, you will still have to login to the machine in order to make the system to draw GUI and this will not guarantee that TestExecute will have enough permissions to access this GUI without any problems.
You need to find a way to run TeamCity build agent as an interactive app, not as a service.
You can also find more information on this topic here.

Resources