Monday 9 January 2012

Check points in QTP

CHECK POINTS

1)  Standard Check Point
We can use this check point to verify the property of an object.
Ex: Verify Update Order
Step Name
Step description
Expected result
Actual
Status
Step-1
Activate Window
Disable


Step-2
Open Record
Disable


Step-3
Perform change
Enable



Navigation

Start Recording Æ Click on “Ok” Æ Activate Window (Flight 4a.exe) Æ File Menu Æ Click on Open Order Æ Select Order No. Æ Enter No. Æ Click on Ok Æ Perform any change Æ Click Update Order Æ Stop Recording Æ Keep the application (Flight4a.exe) in base state Æ Identify positions in the Test Script to insert Check Points [After Activate window; after open order; after perform change] Æ Start Recording Æ {Insert Menu Æ Check Points Æ Click on
Standard Check Point} {or F12} Æ show object [ ] with Æ Click Ok Æ Enter
Name of the Check Point Æ Select Property with expected value (Enable-True = Enable; Enable-False = Disable)Æ Click Ok Æ Stop Recording after insertion of all Check points at relevant places Æ Click Run Æ Analyze results manually.
Ex:1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Update Order").Check CheckPoint("CP_1") Window("Flight Reservation").WinMenu("Menu").Select "File;Open Order..." Window("Flight Reservation").WinButton("Update Order").Check CheckPoint("CP_2") Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON" Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set "30" Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click Window("Flight Reservation").WinRadioButton("Economy").Set Window("Flight Reservation").WinButton("Update Order").Check CheckPoint("CP_3") Window("Flight Reservation").WinButton("Update Order").Click
wait (10)
If Window("Flight Reservation").ActiveX("Threed Panel Control").GetROProperty("text") ="Update Done..." Then
msgbox ("Test is pass")
else
msgbox ("Test is fail")
End If
How to edit existing check point:

Place the cursor on Check Point which you want to edit Æ Right Click Æ Check Point Properties Æ Select property Æ Change value or Rename Check

Point Æ Click Ok.


How to insert check point through Active Screen

Start Recording Æ Record Required Operation like as below [Click on “Ok” Æ Activate Window (Flight 4a.exe) Æ File Menu Æ Click on Open Order Æ Select Order No. Æ Enter No. Æ Click on Ok Æ Perform any change Æ Click Update Order] Æ Stop Recording Æ Keep the application (Flight4a.exe) in base state Æ Identify positions in the Test Script to insert Check Points [After Activate window; after open order; after perform change] Æ place the cursor on specified statement Æ Click on Active Window Æ Right Click on object Æ Click on Insert Standard Check Point Æ Click Ok Æ Enter Check Point Name Æ Select Property with expected value (Enable-True = Enable; Enable-False = Disable) Æ Select option to insert statement (Before current Step / After current Step) Æ Click Ok Æ Click Run after insertion of all Check points at relevant places Æ Analyze results manually.

 
2)  Bit Map Check Point

We can use this Check Point to conduct test on Bitmaps.
Navigation

Start Recording Æ Help Menu Æ Click on about Æ Insert Menu (QTP) Æ Check Point Æ Click Bit Map Check Point Æ Show Bitmap with hand icon
Æ Click Ok Æ Enter Name of the Check Point Æ Click on select area if you want to check a specific area with in the Bit Map Æ Select save only selected area Æ Click on Ok Æ Stop Recording Æ Close current application (Flight 4a)
Æ  Open another application (Flight 4b) Æ Click run to analyze results manually. 

How to insert check point through Active Screen

Start Recording Æ Help Menu Æ Click on about Æ Click on Bit Map Æ Stop

Recording Æ Click on Active Screen Icon  Æ Right click on Bit Map which you want to check Æ Click on Insert Bitmap Check Point Æ Click Ok Æ Enter Name of the Check Point Æ Select area which area to be checked Æ Select option to insert statement (Before current Step / After Current Step) Æ Click on Ok Æ Close current application (Flight 4a) Æ Open another application (Flight 4b) Æ Click run to analyze results manually.


3)  Database Check Point

To automate backend testing we are using Database Check Point. During this testing we are validating backend table in terms of Data validation and data integrity.
Data validation means that the correctness of storing values into backend table.

Data integrity means that the impact of stored values on existing data table content. In this we will be concentrate on primary keys, foreign keys, unique keys, ……. etc.,
To automate backend testing we can follow below approach.


 



Expected Value

= = Fail

= ! Pass


Step 1:
Connect to Database using DSN (Data Source Name)
Step 2:
Execute Specified Select statement.

Step 3:
Retrieve the result of SQL Statement

Step 4:
Perform any db Operation.

Step 5:
Compare expected data with actual data to verify the impact of

frontend operation on backend table content.


Navigation

Insert Menu Æ Check Point Æ Database Check Point Æ Select “Specify SQL Statement Manually” Æ Next Æ Create Æ Machine Data source (Select Data source) Æ Select DSN (QT_FLIGHT32) Æ Click Ok Æ SQL Statement (Enter your specified SQL Statement Ex:. select * from orders) Æ Finish Æ Change the Check Point Name Æ Click Ok Æ Open Frontend (perform any db operation like insert, delete, update) Æ Click Run Æ Analyze results manually.


To Create New DSN

*) First of all you create One database in MS Access with specified table.

Navigation

Insert Menu Æ Check Point Æ Click on Database Check Point Æ Select “Specify SQL Statement Manually” Æ Next Æ Create Æ Machine Data source (Select Data source) Æ New Æ Select type of data source (User [Single user] / System Data Source [multiple users]) Æ Next Æ Select a Driver (Microsoft Access Driver) Æ Select database Æ Click Ok Æ Enter Data Source Name with description Æ Click Ok Æ Click Ok Æ Take your specified statement (Table) Ex:. select * from orders) Æ Finish Æ Click Ok.

Note Database Check Point insertion is not possible through Active Screen.





4)  Text Check Point

We can use this checkpoint to conduct test on text present on the object.
Navigation

Start Recording Æ Insert Menu Æ Check Point Æ Click on Text Check Point

Æ Select object with hand icon Æ Click Æ Ok Æ Enter Name of the Check Point Æ Enter your expected Text in ‘Constant’ Æ Select Matching [(1) Match Case (2) Ignore Spaces (3) Exact Match (4) Text Not displayed] Æ Click on Ok

Æ Stop Recording Æ Click run to analyze results manually.

Regular Expression. [A-Z] [a-z] [0-9]*
[A-Z] [a-z] [ ] [A-Z] [a-z]* [A-Z] [a-z]*
                                                                                                                            


How to insert check point through Active Screen

Start  Recording  Æ  Activate  Window  Æ  Stop  Recording  Æ  Click  on  Active

Screen Icon  Æ Right click on object, which object text you want to check Æ Select insert Text Check Point Æ Click Ok Æ Enter Checkpoint Name Æ Expected text fill in ‘constant’ Æ Select Matching [(1) Match Case (2) Ignore Spaces (3) Exact Match (4) Text Not displayed] Æ Select Insert Statement (Before / After Current step) Æ Click Ok Æ Click run to analyze results manually.

Regular Expressions:

Whenever the object text is changing dynamically at run time, we can use

regular expressions. Ex
Expected Srnagar1 John Smith Suresh


5)  Text Area Check Point

We can use this Checkpoint to conduct test on Text present in the specified screen area.

Navigation

Start Recording Æ Insert Menu Æ Check Point Æ Click on Text Area Check Point Æ Select the area specified to check Æ Click Ok Æ Enter Name of the Check Point Æ Enter your expected Text in ‘Constant’ or
click on to give Regular expression Æ Select type of Matching [(1) Match Case (2) Ignore Spaces (3) Exact Match (4) Text Not displayed] Æ Click on Ok Æ Stop Recording Æ Click run to analyze results manually.

Note: Text Area Checkpoint is not possible through Active Screen.

6)  Page Check Point (For Web Pages only)

We can use this Checkpoint to verify the properties of a web page.
Navigation

Start Recording Æ Insert Menu Æ Check Point Æ Select Standard Checkpoint

Æ Show Image / Link with Hand Icon Æ Select Page Æ Click Ok Æ Enter Name of the Checkpoint Æ Select Property [give your expected value (Load time, No. of Images, No of links)] Æ Click Ok Æ Stop Recording Æ Click Run

Æ Analyze Results manually.

7)    Table Checkpoint

We can use this checkpoint to verify the content of a Web Table.
Navigation

Start Recording Æ Insert Menu Æ Check point Æ Select Standard Checkpoint Æ Select Image with Hand Icon Æ Click Æ Select Web Table Æ Click Ok Æ Enter name of the Checkpoint Æ Select Cell Æ Enter your expected data in constant Æ Click Ok Æ Stop Recording Æ Run Æ Analyze Results manually.
Note:

For Web Table
Browser(“Browser Text Object Name”).Page(“Page Name”).WebTable(“Table

Name”).Check CheckPoint(“Check Point Name”)

For Page Check Point

Browser(“Browser      Text      Object      Name”).Page(“Page      Name”).Check

CheckPoint(“Check Point Name”)

8)  Image Check Point

To   verify   the   properties   of   an   Image,   we   can   use   Image
Checkpoint.
Browser(“Browser   Text   Object   Name”).Page(“Page   Name”).Image(“Image

Name”).Check CheckPoint(“Check Point Name”)

Navigation

Start Recording Æ Insert Menu Æ Check point Æ Select Standard Checkpoint
Æ Select Image with Hand Icon Æ Click Æ Click Ok Æ Enter name of the Checkpoint Æ Select Property (Alt) [give your expected value to that property]

Æ Click Ok Æ Stop Recording Æ Run Æ Analyze Results manually.
How can we check Tool Tips Æ Alt Property.

9)  XML Check Point

To verify the content of an XML file we can use this check point.
Navigation

Insert Menu Æ Check point Æ XML Check Point (From File) Æ Browse your XML File path Æ Click Ok Æ Enter name of the Checkpoint Æ Select Element Name Æ Specify your expected value Æ Click Ok Æ Run Æ Analyze Results manually.

10)           Accessibility Check Point

We can use this checkpoint to verify whether the specified Web Page meets W3C (WWWC) Standards or not (World Wide Web Consortium Standards)

No comments:

Post a Comment