Pages

Tuesday, June 21

Message box that will be closed automatically in QTP

Small code to display a message box that will close automatically in the given time without any click.

Dim msg
msg = "This message will automatically close in 10 second"
Set oShell = CreateObject("WScript.Shell")
oShell.Popup msg,10, "QTP School"

In above statement, there are three arguments - 

msg - the content/string of the message box
10 - the time in seconds
"QTP School" - the title of the message box

This is the output of the above code -