Monday, July 11, 2011

Debugging

The following is the debugging process and the operational overview of the different step command available during debugging
Debugging:

Debugging is a process of executing the script or a program in a user desired passion with some temporary breaks in order to identify the errors.

To do the same QTP has provided step commands and break point feature.
Step commands: -
  1. Step into
  2. Step Out
  3. Step over


1. Step into:
Step into is used for executing a single statement then it will step in to the function or action and stops the execution.
2. Step Out:
Step out is used for executing all the remaining statements from the position of pointer in the function of the action and comes out of the function or action and stops execution
3. Step Over:
Step over is used for executing the single statement if that statement is a function call or action call then it will execute all the statements in side the function or action once and stops the execution

Break Point:
Break point is the feature provided by QTP, which is used for breaking the execution temporarily.

Debug viewer Pane:
Debug viewer pane is used for viewing, modifying or setting the currant value of the variables or expressions during the execution break with the help of three tabs by name

  1. Watch expressions
  2. Variables
  3. Command

Reporter utility object

Reporter utility object: -

It is used for reporting an user defined message to the result window

SYNTAX:
Reporter.Reportevent status,”object name”,”message”
Example: Reporter.Reportevent micdone,”my report”,”add button is working fine”.

Status:
Pass
0
Fail
1
Done
2
Warning
3


Transaction point in QTP

Transaction point:
 It is a concept introduced in QTP which is used for calculating the time taken by an application to perform a specific task or the execution time of a block of statement.

QTP has provided the following transaction options.
  1. Start transaction
  2. End transaction

Syntax:
Services.start transaction ”transaction name”
“ statement 1”
“ statement 2
Services.end transaction ”transaction name”

OUT PUT VALUE in QTP:

OUT PUT VALUE: -


Out put value is a feature provided by QTP, which is used for capturing a value from an application or from a database or from a XML file and stores it under specified column in the runtime data table


Operational overview of out put value: -
The out put value feature works in the following phases
  1. Pre-Execution Phase
  2. While –Execution Phase
1. Pre-Execution phase:
            It will capture the field name from which it need to capture the value
            It will generate the corresponding script
2. While-Execution phase:
            Captures the actual value from the field
            Stores it under a specified column in the run time data table

Out Put Values-
There are the following types of out put values

  • Standard Out Put Value: - It is used for capturing property value of a standard GUI object.
  • Text Out Put Value: - It is used for capturing the text present on a specified object
  • Text-Area Out Put Value: - It is used for capturing the Text present in a specified area
  • Data Base Out Put Value: - It is used for capturing a value from the database
  • XML Out put Value: - It is used for capturing a value from the XML file

Navigation for Standard Out put value through application:

  • Keep the cursor in the desired location
  • Keep the tool under recording mode
  • Activate the menu item insert
  • Go to out put value
  • Select the option standard out put value
  • Click on the desired object in the AUT
  • Click on OK
  • Select the desired property to be captured
  • Click on modify
  • Specify the desired column name
  • Click on Ok
  • Once again click on ok
  • Stop recording




Navigation For standard check point through Active Screen

  • Keep the cursor under the desired location
  • Click on active screen
  • Right click on desired location
  • Click on insert output value
  • Click on ok
  • Select the desired property
  • Click on modify
  • Specify the desired column name
  • Click on ok
  • Once again click on ok.

Data Driven Testing in QTP:

Data Driven Testing
                        Data driven testing is a concept introduced in the automation in order to implement re- testing.

Steps to be followed to perform data driven testing:
  • Collect the test data in to the data table
  • Generate the basic test
  • Parameterize the test
  • Execute the Test
  • Analyze the result

Parameterization:
                        Parameterization is a process of replacing the constant values with parameters or variables in order to increase the scope of the test. Parameterize can be done in three ways

  • Through data driver wizard
  • Through key word view
  • Manually

Navigation through Data Driver Wizard:

  • Activate the menu item tools
  • Select the option data driver
  • Click on parameterize
  • Click on next
  • Click on the parameter option button
  • Select the desired column name
  • Click on ok
  • Click on next
  • Click on finish
  • Finally click on ok

   Navigation Through Key word view:

  • Go to key word view
  • Select the desited constant value
  • Click on configure the value button
  • Select the option parameter
  • Select the desired column name
  • Click on ok





To avoid the above navigation one can directly type manually as follows:



A= datatable(“v1”,1)
Vbwindow(“form1”).vbedit(“val1”).set A
Vbwindow (“form1”).vbedit(“val2”).set datatable(“v2,1)
Vbwindow(“form1”).vbbutton(“Add”).Click
Vbwindow(“form1”).vbedit(“res”).check checkpoint(“RES”)
           
Navigation for parameterizing the check point:

  • Right click on the check point statement
  • Select the option check point properties
  • Select the option parameter
  • Click on the parameter options button
  • Select the desired column name
  • Click on ok
  • Once again click on ok
We can also parameter the test objects from object repository/object repository manager.