Micro Focus QTP (UFT) Forums
Recovery Manager not handling windows pop up error message. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Recovery Manager not handling windows pop up error message. (/Thread-Recovery-Manager-not-handling-windows-pop-up-error-message)



Recovery Manager not handling windows pop up error message. - sanjuktab - 07-30-2008

Hi everyone.
I am relatively new to QTP. I am trying to resolve the pop up error message which comes when i enter login name with less than 4 characters (Sample Flight application with QTP) with Recovery Manager.
I have added 2 recovery scenarios for handling the same:
1. Clicking on the OK button of the pop up error window.
2. Next clicking on Cancel button of the Login window.

But after re-running the test, it fails with the error messages popping up again and nothing happening.

Please tell me what could be the problem?where am i going wrong?
P.S: I have linked the 2 recovery scenarios from File-Settings with appropriate priority.


RE: Recovery Manager not handling windows pop up error message. - Ankur - 07-30-2008

Well, I don't think this is an ideal case to use Recovery scenarios... You can simply use If-Else statement with .Exist method to check for the error pop-ups.

Note that though Recovery scenario are nice to use, they should be used judiciously as they tend to lower the speed of script execution.


RE: Recovery Manager not handling windows pop up error message. - sanjuktab - 07-30-2008

ok..thanks ankur..
will try that..
then can u give me one scenario with the existing application where i can use Recovery scenarios..


RE: Recovery Manager not handling windows pop up error message. - Ankur - 07-30-2008

Please refer the post on using Recovery Scenarios in QTP


RE: Recovery Manager not handling windows pop up error message. - gammaflare - 08-06-2008

Instead of using QTP to deal with the pop-ups, you can use vbscript to disable the popups directly by accessing the Hkeys in the registry. Below is the code for:

'If the address(URL) in a certificate is not valid
Code:
HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\"&strComputer& "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\InternetSettings"
ValueName = "WarnonBadCertRecving"
dwValue = 0
objReg.SetDWORDValue HKEY_CURRENT_USER, strkeypath, ValueName, dwValue

'Issue a warning if you are switching between secure and non-secure sites
Code:
HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\"&strComputer& "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\InternetSettings"
ValueName = "WarnonZoneCrossing"
dwValue = 0
objReg.SetDWORDValue HKEY_CURRENT_USER, strkeypath, ValueName, dwValue

'Issue a warning when information is sent to another website
Code:
HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\"&strComputer& "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\InternetSettings"
ValueName = "WarnonPostRedirect"
dwValue = 0
objReg.SetDWORDValue HKEY_CURRENT_USER, strkeypath, ValueName, dwValue

Put the above code in a function or a library and associate the library with your tests.

The above solution proved a lot faster and reliable than Recovery Scenarios and .Exist methodologies.


Tell us all if the above worked for you. If it has, other users will be sure where to look for when they encounter this problem.


RE: Recovery Manager not handling windows pop up error message. - butair - 09-30-2008

I was realizing the same problem. Took much trial and error but I got the same scenario working as described by sanjuktab. The pop up wasn't recognized as an error. When I changed File/Settings/Recovery's "Activate recovery scenario" to "On every step". The script went through fine.

I understand RecSc can slow down the script execution but need to put this through the paces to understand how the operation works. Once I actually did it now I understand more about it's behavior. I also am looking for an "error" to capture and record a RecSc on it. I will try that tomorrow. I don't know VbScript to use the If-then-else approach in expert view.