Monday, December 23, 2013

How to Handle “Dialogs” in Firefox (using QTP)

Sometimes QTP doesn’t recognize a dialog in Firefox. These types of Dialogs are not caught by the Object Spy and it seems difficult to handle it if its appearing somewhere in your application. Following code helped me get out of this situation :-
dialogText=Browser(“creation time:=0″).GetDialogText
If Instr(dialogText,”Text that you are looking for”) Then
Browser(“creation time:=0″).HandleDialog micOK
Else
Print “Unknown Dialog Found”
End If
The above code will click on the OK button if the “Text that you are looking for” (this can be any user defined value) matches the Text that is displayed on the Dialog.

No comments:

Post a Comment