Friday, 22 May 2015

UFT CUSTOM REPORT

1.     Introduction
Automation can be stated as the use of methods for controlling industrial processes automatically, especially by electronically controlled systems, often reducing the manual effort, reduces the time consumed for the overall process, hence making it a strong powerhouse by increasing the productivity and maintainability to much greater extent.

Quick Test Professional (QTP) tool is being used for IRIS Automation. A report is generated at the end of execution of a Test script. This QTP Report is a summarized document that contains information about the process, object parameters, number of steps, pass and failures that occurred during the run.

2.     Why to prefer Custom Report over QTP Report?
As the report that is generated by the QTP is:
  • Too detailed and descriptive i.e. contains extra information than required.
  • Prior knowledge of the tool is essential to understand and navigate through the report.
  • Needs a QTP tool installed in the system if report is not converted to either pdf, html etc which needs to be generated manually.
With the advent of Custom Report all these drawback can be overcome. A Custom Report is a customized document that is generated at the end of the execution of a Test Script without manual intervention. The advantages of the custom report are listed below:
  • Easy to understand and implement, no prior knowledge required.
  • Information content is specific to Test case and not much detailed.
  • Contains images associated with the particular step which can be viewed (Zoom in and Zoom out) easily.
  • We can use Custom report reusable (Other Application)
  • Custom report generates all the info regarding test cases, Executed by, Environment, Date etc.
  • Clicking on steps dynamically it generates the Description, Expected result, Actual result and Screenshot for the specific steps.
  • If we have multiple Screenshot in step it will create scrollbar dynamically and multiple screenshot.
  • After execution of one scripts (Test case), Custom report automatically saved into QC Test lab.
3.     Custom Report Generation

The following parameters need to be declared initially before the scripting for the script is started. As shown in the figure below (Variable Declarations). These variables are associated with the function that is processed as per the requirements and demands of the Test case report. Hence these variables have to be initialized to generate a report specific to test case.
A function is written in QTP using VB Script, html, JavaScript which when called in the main script after each step generates a report in “Mhtml” format and is directly attached to the Test in the Quality Center. This Test report can be viewed by double clicking on the “.mht” icon.

'***********************************************************************************************************************************************
' Template Script Name:   LOGIN
' Purpose:                      The system shall be able to login to the application
' Pre-conditions:            
' Author:                       Dileep Sarkar
' Creation Date:           06/05/2015  
'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
' Revision History
'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
' Modified date:  
' Modified By:       
' Details:                
'***********************************************************************************************************************************************
'Varibales used 
'******************************************************************************************************************************************************************************
Public arrImagePath(20), arrImagePurpose(20)
Dim Variable1, Variable2, Variable3, Variable4

Environment.Value("Variable1")=null
Environment.Value("Variable2")=null
Environment.Value("Variable3")=null
Environment.Value("Variable4")=null
Environment.Value("strTestCaseID") = "TC_SS_CHG_UAT_HPQC_009"
Environment.Value("intStepID") = 1
Environment.Value("intPassed") = 0
Environment.Value("intSteps") = 32
Environment.Value("strFooter")=null
Environment.Value("boolLoginValidation")="True"
Environment.Value("boolLogoutValidation")="False"

'******************************************************************************************************************************************************************************
'Varibales used End
'******************************************************************************************************************************************************************************
'******************************************************************************************************************************************************************************
'Load test data from QC
'******************************************************************************************************************************************************************************

Reporter.Filter =3


Custom Report UI


Sunday, 15 January 2012

Hi ,
QTP advanced level real time question now available on this site i will keep on posting different type of
QTP Advanced level question and answer .


Regards
Dileep Sarkar