QTP checkpoints

Question ID: 104738
1
0

I want a checkpoint to delay a test when it fails at a checkpoint and let me know. When I run it from QC, it doesn’t pop up the normal failed message. Is there any way to do this?

Marked as spam
Posted by (Questions: 175, Answers: 22)
Asked on December 6, 2012 9:51 am
17 views
Answers (1)
3
Private answer

Luckily, all checkpoints in QuickTest return True/False when they execute. You can use this to invoke your own messages by including a simple If/Then statement and a VBScript MsgBox command. Please notice that the checkpoint statement is modified slightly from the original checkpoint statement with added parenthesis. These are used because we are returning a value back to a variable:

Sample:

retVal = Browser(''MSN'').Page(''Welcome...'').Check(CheckPoint(''Login''))
If retVal = False Then
MsgBox ''The checkpoint failed.''
End If

Of course, using that logic, you could enhance it to use an Else statment as well if you wanted to do something if the checkpoint passed, etc., but this will give you the basics.

Marked as spam
Posted by (Questions: 2, Answers: 425)
Answered on December 6, 2012 9:53 am