This is my personal blog for my software testing study purposes. The topics posted in this blog are mine and from some other sources (credits are given). I always add those topics which helps me. Hope these topics will help you guys also.
- Happy testing!

QTP10.com is a new and completely free website that offers help in all the versions of HP QTP (including latest version 10). More importantly, it offers free code for users of HP QuickTest Professioal. This site helps you in learning the basics of QTP and descriptive/advanced programming in (QTP) on various environments like - .Net, Infragistics, Web, Windows, etc.

Note -
This blog is NOT affiliated with HP / Hewlett-Packard in any way. The data/questions come from various sources and we have our own testing questions. I am just another Software Tester like you.

Recent Posts

QTP & Keyword Driven Testing

Tricky Questions in QTP

Asset Upgrade tool in QTP

New Features in QTP 10

Sunday, May 24, 2009

QuickTest Professional script for Message Boxes That Close Automatically

Subscribe to Free QuickTest Professional Newsletter

SPONSORED LINKS

Using Message Boxes That Close Automatically
The function below shows a message box that disappears after the specified timeout (in seconds). The script execution then continues.

Public Sub MsgBoxTimeout (Text, Title, TimeOut)

Set WshShell = CreateObject("WScript.Shell")

WshShell.Popup Text, TimeOut, Title

End Sub

If TimeOut is 0, it behaves just like a normal message box. If TimeOut is greater than 0, the dialog box disappears after the specified number of seconds.

Comments :

2 comments to “QuickTest Professional script for Message Boxes That Close Automatically”

jatinder singh sodhi said...
on 

when i used this code then it open the same message box again so please clear it why its happened.

Ranjan said...
on 

When you are using this code.
Don't use Msgbox separately and MsgBoxTimeout separately. It should be used only once.
What ever you want in msgbox should be 'text' for MsgBoxTimeout.
E.g. MsgBoxTimeout variable name , ""(if title is blank), 2

 

Copyright © 2009 by Guide to QuickTest Professional 10