Highlighted
Honored Contributor.
Honored Contributor.
398 views

Triggering n action once UFT is stuck - possible??

Hi there,
I have a request from our development team to write an automation script that performs some activity, and has to be left unattended for hours on end...

Now and then something happens and the AUT does not react well, and UFT gets stuck. (lag, menu doesn't open etc...) In this case, a long time may pass until the error is "found/seen" by the customer, and this lost time is crucial for us. We cannot afford to let this pass by becuase there are deadlines for the activity.

Has anyone here ever created something that can "trap" UFT's abrupt stop, in any  way? I have functions that can trigger an email or even a SMS. How would I be able to protect this run from these small but critical downfalls?

0 Likes
12 Replies
Highlighted
Respected Contributor.
Respected Contributor.

Re: Triggering n action once UFT is stuck - possible??

Hello.

I hope you are doing well.

Thank you for contating Microfocus technical support.

As per description, I understood that you want to recover the scenario and keep working with UFT I recommend the following:

Recovery Scenarios

https://admhelp.microfocus.com/uft/en/14.03/UFT_Help/Content/User_Guide/z_Ch_RecovScenarios_GUI.htm

A recovery scenario consists of the following:

Trigger Event. The event that interrupts your run session. For example, a window that pops up on the screen, or a run error.

Recovery Operations. The operations to perform to enable the run session to continue after the trigger event interrupts the session. For example, clicking an OK button in a pop-up window, or restarting Microsoft Windows.

Post-Recovery Test Run Option. The instructions on how UFT should proceed after the recovery operations are performed, and from which step to continue, if at all. You may want to restart the run from the beginning, or skip a step entirely and continue with the next step

Please let me know if this information was useful for you.

Thank you in advance.

Kind regards,

Susse

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Triggering n action once UFT is stuck - possible??

I am checking this , thank you for now.

 

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Triggering n action once UFT is stuck - possible??

Recovery scenarios would not work if UFT is stuck, personally I don't think there's a solution for your scenario.

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Triggering n action once UFT is stuck - possible??

Hi StickyFingaz.

This is exactly what I am thinking. Because recovery scenarios are not a recommened thing to use in general...

I thought about using some external executable utility, perhaps something I will write in VBS, that will monitor UFT's activity through a certain file. If UFT will stop "reporting" to that file, then the VBS code, will have to dispatch an email or SMS...

The idea is that UFT is running something in the production environment. It must be known and informed in a timely manner, if UFT stops for some reason.

 

Do you have any ides for me??

 

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: Triggering n action once UFT is stuck - possible??

I totally agree, how do you trap a UFT is not responding" issue from within UFT, its a catch 22 situation.

I think the best you could do is to cut your scripts/iterations into smaller parts. You could then schedule them via Jenkins to run with a reasonable interval between them to allow them to finish. Prior to each run Jenkins should call a small script to kill UFT.exe if it is running.

You will need to add a step to your UFT scripts to tidy up any leftovers from the last run (kill any running browsers etc)

Mark Smith.

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Triggering n action once UFT is stuck - possible??

Hi,
When you say : 
"You will need to add a step to your UFT scripts to tidy up any leftovers from the last run (kill any running browsers etc)"

I believe you mean that ths code should be placed int he very beginning of the script... or am I missing siomething here?
Since there i no way to anticipate when UFT will get stuck and why, I cant think of where to put and "cleanup" statements.
Of course there are already cleanups at the very end of the script , but that is only when everything goes fine and the script actually reaches the end as expected.

Assuming I go with your approach, but without Jenkins since I need to keep it simple and local, wht do you think of a dummy file, that gets updated from UFT every 1 minute. And there is a VBS that is executed from within UFT itelf (!). This VBS file in turn, will monitor the "date modified" property of the dummy file. If there will be a time-delta of over 5 minutes then the VBS file will need to dispatch an e-mail of SMS (still have to figure out how to do this).

Ideas? Comments?

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Triggering n action once UFT is stuck - possible??

Anyone..??

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Triggering n action once UFT is stuck - possible??

hi, 

I think you may launch another program from Jenkins, or even a persisting one on that slave machine, to monitor the responsiveness of UFT. Thus, the running and checking are separated. UFT won't be responsible for the detection of its own hanging.

Thanks.

James

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Triggering n action once UFT is stuck - possible??

Hi James.

Can you please explain this..:
    ",,,to monitor the responsiveness of UFT...."

What do you test here and how do you check it?

Thanks!

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Triggering n action once UFT is stuck - possible??

hi, 

You may check for a way to test if a process is responding or not. An example below:

https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.responding?view=netframework-4.7.2

Thanks.

James

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Triggering n action once UFT is stuck - possible??

Hi James,


When you say :  "You may check for a way to test if a process is responding or not...."
When UFT is stuck  ( the debug, stop, retry dialog appears...) it is not in "NOT RESPONDING" mode, so what am I suppose to check here ?

Is it somehing I check in the "task manager" ?

 

 

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.