Thursday, January 22, 2009

How to Close QTP displayed message box with QTP Code?

Sub CMsgbox(strText)
Dim objShell, buttonName
Set objShell= CreateObject("WScript.Shell")
' Display the message box with message and clost itself after 5 seconds
buttonName= objShell.Popup(strText, 5, "Message Box", 0)
End Sub

MessageText= "To know, look at this message box. It will close itself"
' Call the Procedure for message display and close it.
CMsgbox MessageText

No comments:

Post a Comment