Issues with checkpoints?


Handling checkpoints issues in QTP:

It’s often said, a little effort makes a big difference..sounds pretty cool right?
Newbies are unfamilier with it and the grandpa (Experts) look down on it…here comes
an amazing syntax that qtp possesses:Reporter.Filter = rfDisableAll

Well it’s not great issue to write the above syntax and i won’t feel that i have solved a
great issue.This question often arises on different QTP Forums;I am going to shed some basic lights on it:

How to handle checkpoints with scripting? Why my scripts always shows result=fail when i use rfDisableAll for one checkpoint?

Checkpoint provides a basis for confirming or validating the existence of data, but it also controls the test result status i.e pass or fail.

If your test passes well and the checkpoint fails then test result will be shown as Failed,hence,to overcome the issue we can use the following command:
Reporter.Filter = rfDisableAll

Now we can report in our own way;let’s discuss:

Example:Checking the existence of Username text box through checkpoint
**************************************************************
Reporter.Filter = rfDisableAll

chk_res=Browser(“micclass:=Browser”).Page(“micclass:=Page”).WebEdit(“index:=0”).Check (Checkpoint(“Txt_username”))

Reporter.Filter = rfEnableAll

If chk_res Then

msgbox “Yeah.. done!!”

else msgbox “Oops!!”

End If
**************************************************************

If you do not enable then no reporting will be done for the upcoming steps 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: