I am trying to handle chrome alerts through UFT(Unified Funtional Testing)/QTP(Quick Test Professional). There are only a few options such as Insight objects, sendkeys or by coordinate values. I need more robust way to handle these alerts. Like how the selenium does with help of webdriver. Is there any other way to handle alerts externally such that those methods can be triggered through a .vbs file? Please suggest.
Asked
Active
Viewed 5,306 times
1 Answers
3
UFT has the Browser.HandleDialog
functionality which allows clicking OK on alert
and confirm
dialogs, clicking Cancel on confirm
and prompt
dialogs and entering values for prompt
dialogs.
Usage:
Browser("B").HandleDialog micOK
Browser("B").HandleDialog micCancel
Browser("B").HandleDialog micOK, "value for prompt dialog"

Motti
- 110,860
- 49
- 189
- 262
-
During recording, I click the ok button and I get this code Browser("Create New record").HandleDialog micOK. During run time I get this error "This operation can not be performed". Please advise. – bugfinder Jun 26 '18 at 14:54
-
@bugfinder, this sounds like a bug, have you tried contacting UFT's support? – Motti Jun 26 '18 at 19:45
-
1I did and they said "UFT can not handle JS alerts or dialog boxes, so it is an expected behavior". Insight object works but it may not work other machines. I am stuck. Any other workaround? – bugfinder Jun 28 '18 at 20:26
-
@bugfinder which version of UFT are you using? – Motti Jul 01 '18 at 11:00
-
14.00/Build 1775 – bugfinder Jul 03 '18 at 17:47
-
I will look up the person. Thanks. – bugfinder Jul 05 '18 at 15:28