Wednesday, 17 September 2014

QTP - CheckPoints

What are CheckPoints?

Checkpoints, as the name says it all, it refers to a validation point that compares the current value for specified properties or current state of an object with the expected value which can be inserted at any point of time in the script.

Types:

TypeDescription
Standard CheckpointVerifies the property values of an object in application under test and supported by all add-in environments.
Bitmap CheckpointVerifies an area of your application as a bitmap
File Content CheckpointVerifies the text in a dynamically generated or accessed file such as .txt,.pdf
Table CheckpointVerifies the information within a table. Not all environments are supported.
Text CheckpointVerify if the text that is displayed within a defined area in a Windows-based application, according to specified criteria.
Text Area CheckpointVerifies if the text string is displayed within a defined area in a Windows-based application, according to specified criteria.
Accessibility CheckpointVerifies the page and reports the areas of the Web site that may not conform to the World Wide Web Consortium (W3C) Web Content Accessibility Guidelines
Page CheckpointVerifies the characteristics of a Web page. It can also check for broken links.
Database CheckpointVerifies the contents of a database accessed by the application under test.
XML CheckpointVerifies the content of the .xml documents or .xml documents in Web pages and frames.



Example:

The checkpoints are added for the application under test - "http://easycalculation.com/"


' 1. Inserted Standard Checkpoint
Status = Browser("Math Calculator").Page("Math Calculator")
.Link("Numbers").Check CheckPoint("Numbers")

If Status Then
   print "Checkpoint Passed"
Else
   Print "Checkpoint Failed"
End if

' 2. Inserted BitMap Checkpoint
imgchkpoint = Browser("Math Calculator").Page("Math Calculator")
.Image("French").Check CheckPoint("French")

If imgchkpoint Then
   print "Checkpoint Passed"
Else
   Print "Checkpoint Failed"
End if

No comments:

Post a Comment