QTP Tutorials 6 - Database Checkpoint
Now we will try out Database checkpoint: using Oracle 9i
First of all you have to connect oracle 9i to QTP 9.(before doing any recording)
For this go to Insert -> Checkpoint -> Database Checkpoint.
A Database Query Wizard opens.
Select ' Specify SQL statement manually' from the Query definition area. Click Next.
Here click on 'Create' button which is on the right of "Connection String:" It will open 'Select Data Source' window. Click on 'Machine Data Source' Tab
Click on New Button.
'Create New Data Source' window opens.
Select 'User Data Source' from Select a type of data source. Click Next.
It will show all the data source drives it could find.
Select Oracle (on my machine it was 'Oracle in OraHome9'). Click Next. Click Finish.
It will open 'Oracle ODBC Driver Configuration' window.
Enter 'Data Source name' ( I entered "oracle")
Enter 'description' (I entered "SQL")
Select 'TNS Service Name' ( I selected 'DB02', my oracle database name) from combo box.
Enter userid (I used SCOTT).
Click 'Test Connection' Button.It will ask for a Password. Enter your password for Oracle.
If successful it will show 'Testing Connection' window with 'Connection Successful' written on it.
This completes our task of Connecting QTP with Oracle.
Now we will record a test.
Open a blank test.
Click on Record. When we click on Record, "Record and Run Settings" window opens up. Go to "Windows Applications" tab and choose first option "Record and run test on any open Windows based application." and click on ok.
Go to Insert (menu)->Checkpoint->Database Checkpoint
A 'Database Query Wizard' opens.
Select ' Specify SQL statement manually' from the Query definition area. Click Next. Click Create.
Go to 'Machine Data Source' Tab
Select Oracle from data source name. Click Ok. It will open 'Oracle ODBC Driver Connect'
Enter password. Click ok
It will come to Database Query Wizard window with 'Connection String' field filled with: "DSN=oracle;UID=SCOTT;PWD=TIGER;DBQ=DB02;DBA
=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;
LOB=T;RST=T;GDE=F;FRL=F;BAM=IfAllSuccessful;MTS=F;
MDI=F;CSR=F;FWC=F;PFC=10;TLO=0;"
In the SQL Statement area type "select * from emp;". Click Finish.
It will open 'Database Checkpoint Properties' window with the result of the query. Click Ok.
Click Stop in order to stop the Recording.
In the Expert View, it just adds one line "DbTable("DbTable").Check CheckPoint "DbTable")"
This is the simplest database checkpoint example.
Lets run it.
Click on Run. ( we don't need to open any other window or application to run this as our Oracle is running at the back end as a service - default way in which it was installed- nothing special.)
When it is passed it will show following in the Result window:
Test Checkpoint-database Summary (where Checkpoint-database is the name with which I saved the test)
Run-Time Data Table
Checkpoint-database Iteration 1 (Row 1)
Action1 Summary
DbTable
Checkpoint "DbTable"
( when you click on this, in details it will show checked 112 cells (in your case number of cells may differ). It means if you go to the oracle and add or delete any row and run this test again it will fail.)
Just try to think how QTP is comparing the expected results with the actual one, with the count of cells.
Showing posts with label QTP Standart Checkpoints. Show all posts
Showing posts with label QTP Standart Checkpoints. Show all posts
Saturday, September 27, 2008
QTP Page Checkpoint
Page checkpoint:It is for web applications only.Common things to check with this are load time, broken links etc.
Open a blank test.
Make sure thathttp://www.google.co.in/ is open.(Now only QTP with blank test and www.google.co.in should be open.)
Click on Record. When we click on Record, "Record and Run Settings" window opens up. Go to "Web" tab and choose first option "Record and run test on any open browser." and click ok.
Go to Insert (menu)->Checkpoint->Standard Checkpoint (or press F12).
The mouse pointer will become hand and QTP will be minimized.
Click anywhere on the white space on the Google.co.in page.
It will Open "Object Selection - Checkpoint Properties" window. Click on 'Page : Google' option which has a page icon on left of it with right corner of the page slightly folded.
Click ok.
A 'Page Checkpoint Properties' window opens up. Let all the options be default. Click ok.
Click on Stop in order to stop the Recording.
In the Expert view it will add just one line:
Browser("Google").Page("Google").Check CheckPoint("Google")
We will explore this line later on.
I ran this test by opening www.google.co.in in offline mode (not on internet). It recorded the following properties:
Property Name Property Value
load time "0"
number of images "2"
number of links "20"
Here it shows the load time as 0 because I did not open Google at the time of running the test, it was already open.
When you run it, in the results window, on left hand side, it will show (when every option is expanded):
Test Checkpoint-page Summary (where Checkpoint-page is the name with which I saved the test
Run-Time Data Table
Checkpoint-page Iteration 1 (Row 1)
Action1 Summary
Google (This will be the browser)
Google (This will be the Page)
Checkpoint "Google"
If you run this test on www.google.com it may fail.
Open a blank test.
Make sure thathttp://www.google.co.in/ is open.(Now only QTP with blank test and www.google.co.in should be open.)
Click on Record. When we click on Record, "Record and Run Settings" window opens up. Go to "Web" tab and choose first option "Record and run test on any open browser." and click ok.
Go to Insert (menu)->Checkpoint->Standard Checkpoint (or press F12).
The mouse pointer will become hand and QTP will be minimized.
Click anywhere on the white space on the Google.co.in page.
It will Open "Object Selection - Checkpoint Properties" window. Click on 'Page : Google' option which has a page icon on left of it with right corner of the page slightly folded.
Click ok.
A 'Page Checkpoint Properties' window opens up. Let all the options be default. Click ok.
Click on Stop in order to stop the Recording.
In the Expert view it will add just one line:
Browser("Google").Page("Google").Check CheckPoint("Google")
We will explore this line later on.
I ran this test by opening www.google.co.in in offline mode (not on internet). It recorded the following properties:
Property Name Property Value
load time "0"
number of images "2"
number of links "20"
Here it shows the load time as 0 because I did not open Google at the time of running the test, it was already open.
When you run it, in the results window, on left hand side, it will show (when every option is expanded):
Test Checkpoint-page Summary (where Checkpoint-page is the name with which I saved the test
Run-Time Data Table
Checkpoint-page Iteration 1 (Row 1)
Action1 Summary
Google (This will be the browser)
Google (This will be the Page)
Checkpoint "Google"
If you run this test on www.google.com it may fail.
QTP Standart Checkpoints
Checkpoints cannot be added manually, they are inserted using QTP's interface. Results of the checkpoint can be viewed in the Test Results Window.
Checkpoint information is stored in the Local Object Repository. It is in the Resource.mtr file which is in the action folder (if you created checkpoint in action1 then it will be action 1 folder under the folder in which you are saving the test/script, if you created checkpoint in action 2 then it will be action 2 folder and so on) .
In the expert view, on any blank line type Checkpoint and put "(". As soon as you put the starting bracket it will show all the checkpoints you have used in the test.
Now we will start with checkpoints. I will try to show easy to understand example of each and every checkpoint.
Lets start with simple example of standard checkpoint which checks a variety of objects such as buttons, radio buttons, combo boxes etc. Standard checkpoints are supported for all add-in environments
Open a blank test.
Make sure that Flight application is open.(Now only QTP with blank test and Flight application should be open).
Click on Record. When we click on Record, "Record and Run Settings" window opens up. Go to "Windows Applications" tab and choose first option "Record and run test on any open Windows based application." and click ok.
Go to Insert (menu)->Checkpoint->Standard Checkpoint (or press F12).The mouse pointer will become hand and QTP will be minimized.
Click on the "Flights..." button which is on the Right Hand Side of the "Fly To" combo box in the Flight application.
It will open "Object Selection - Checkpoint Properties" window (with WinButton:FLIGHT highlighted). Click ok.
It will open checkpoint properties window. (only one property will be checked in it i.e. 'enabled' with a value of False.)
Click ok. Click on Stop in order to stop the Recording.
Save the test.
This is a small test in which we have used standard checkpoint and captured the disabled button on the Flight application. Now we can run the test in two ways to see how it fails and passes the results of the checkpoint.
To see a pass test result:
Make sure that this test and Flight application is open.Click on run.It will Run the test and show you the result as pass.
To see a Fail test result:
Make sure that this test and Flight application is open.
In the Flight application enter the Date of Flight, Fly From and Fly To fields and nothing else. (The reason for doing this is that it will enable the 'Flight...' button)Click on run in order to run the test.It will Run the test and show you the result as Fail. This is because QTP was looking for a disabled 'Flight...' button for which it recorded the information at the record time, but now since the button was enabled at run time, so it failed.
This will help you in understanding the standard checkpoint in QTP more deeply.
Checkpoint information is stored in the Local Object Repository. It is in the Resource.mtr file which is in the action folder (if you created checkpoint in action1 then it will be action 1 folder under the folder in which you are saving the test/script, if you created checkpoint in action 2 then it will be action 2 folder and so on) .
In the expert view, on any blank line type Checkpoint and put "(". As soon as you put the starting bracket it will show all the checkpoints you have used in the test.
Now we will start with checkpoints. I will try to show easy to understand example of each and every checkpoint.
Lets start with simple example of standard checkpoint which checks a variety of objects such as buttons, radio buttons, combo boxes etc. Standard checkpoints are supported for all add-in environments
Open a blank test.
Make sure that Flight application is open.(Now only QTP with blank test and Flight application should be open).
Click on Record. When we click on Record, "Record and Run Settings" window opens up. Go to "Windows Applications" tab and choose first option "Record and run test on any open Windows based application." and click ok.
Go to Insert (menu)->Checkpoint->Standard Checkpoint (or press F12).The mouse pointer will become hand and QTP will be minimized.
Click on the "Flights..." button which is on the Right Hand Side of the "Fly To" combo box in the Flight application.
It will open "Object Selection - Checkpoint Properties" window (with WinButton:FLIGHT highlighted). Click ok.
It will open checkpoint properties window. (only one property will be checked in it i.e. 'enabled' with a value of False.)
Click ok. Click on Stop in order to stop the Recording.
Save the test.
This is a small test in which we have used standard checkpoint and captured the disabled button on the Flight application. Now we can run the test in two ways to see how it fails and passes the results of the checkpoint.
To see a pass test result:
Make sure that this test and Flight application is open.Click on run.It will Run the test and show you the result as pass.
To see a Fail test result:
Make sure that this test and Flight application is open.
In the Flight application enter the Date of Flight, Fly From and Fly To fields and nothing else. (The reason for doing this is that it will enable the 'Flight...' button)Click on run in order to run the test.It will Run the test and show you the result as Fail. This is because QTP was looking for a disabled 'Flight...' button for which it recorded the information at the record time, but now since the button was enabled at run time, so it failed.
This will help you in understanding the standard checkpoint in QTP more deeply.
Subscribe to:
Posts (Atom)