Thursday, August 29, 2013

Add Remove Object Repository Dynamically in QTP

HP QTP provides a great functionality for adding or removing Object Repository at run time or dynamically. For that ObjectRepositories Utility object of QTP is used. 

Find the below code for Add/Remove Object Repository dynamically in QTP during run time.

'*********************************************************
'Function Name: AddRemoveOR
'Purpose: Use for Add Or Remove Object Repository with Action Name
'Inputs:
    'repositoryPath=Repository Path for Add or Remove with Action
    'actionName=Action Name for Add for Add Or Remove Repository
    ' operationName=Operation Name to be Perform either "Add" or "Remove" Object  Repository
'Return Values: -
'Created By: Krutin Gandhi
'*********************************************************

Function AddRemoveOR(repositoryPath,actionName,operationName)  

    Dim qtApp,qtRepositories, actName, RepPath,  rPosition'Variable Declaration

    RepPath=repositoryPath 'TRS File Path
    actName=actionName   'Get Action Name
    Set qtApp = CreateObject("QuickTest.Application")    ' Create Application Object
    Set qtRepositories = qtApp.Test.Actions(actName).ObjectRepositories    ' Get Associated repositories list

        'Adding Repository to an action
        If operationName="Add" Then       
            If qtRepositories.Find(RepPath) = -1 Then
                qtRepositories.Add RepPath, 1    ' Add the Object Repository to the current action 
            End If

        'Remove Repository to an action
        Else if operationName="Remove" Then
            rPosition=qtRepositories.Find(RepPath) 'Find the Position of the Repository
            If  rPosition<>-1 then
                qtRepositories.Remove rPosition  ' Remove Repository From the Action
            End if           
        End If
    End If

    'Assign nothing
    Set qtApp= Nothing
    Set qtRepositories= Nothing
End Function

Friday, July 6, 2012

Business Process Testing Challenges

What is Business Process Testing ?
  • It is an additional licensed module of Quality Center.
  • It is a transformation, not a technology.
  • It helps to create reusable business components – Manual & Automated of a test (s).
  • Business Component : Non-Scripted and Scripted.
  • It accelerates the automation in large ERP Apps – SAP & Oracle Apps.
Challenges of Business Process Testing
  • Required Highly Level domain knowledge to a create Business Process Testing Component.
  • The input data required for executing the Business Process should be reusable.
  • Business Process should be complete, correct and accurate.
  • Business Process Components should also be compatible with lower versions of Quick Test Professional and Quality Center.
  • Some times Subject Matter Experts require technical knowledge because:
    • Some initial Components might prove complete for some Business Process’s, but there will surely be a need to create new components in order to complete all the scripts.
    • Though UI Scanner automatically generates the required components, it might be required to manually modify the Quick Test Professional code, or even to manually create a whole component.

Tuesday, November 1, 2011

QTP 11 New Features


HP QuickTest Professional software version 11 is now available in market. In QTP 11, There are many updates as compare to QTP 10. Following are some features of QTP 11 which are new as compare to old QTP 10.
  • Support for new Operating Systems
  • Enhanced Data Management Facility
  • New Object Spy Functionality
    • Add an object to a repository
    • Highlight an object in our application
    • Copy/paste object properties
  • New Smart Regular Expression list
  • New QTP-Service Test integration facility
  • New Run Results Viewer
  • New facility to hide the Keyword View
  • Facility to add Images to Our Run Results
  • New Log Tracking Functionality
  • Automatic Parameterization of Steps
  • New Visual relation identifiers
  • Visual indication of Version Control Status of Tests
  • Web 2.0 add-ins support
  • New capabilities for working with Web-Based objects
    • Firefox Testing
    • XPath, CSS, Identifiers
    • Event Identifiers
    • Embed or Run JavaScripts in our Web Pages
  • New methods for testing Web-based Operations
  • New methods for testing Web-based Operations
  • New LoadFunctionLibrary statement
  • Improved checkpoints and output value objects management
  • Dual Monitor Support
  • New QTP Asset Upgrade Tool for HP ALM and Quality Center
  • Test execution in minimized remote desktop protocol session
  • Improved Web Add-in Extensibility
  • Improved Business Process Testing
  • New Extensibility Accelerator for Functional Testing

Tuesday, October 4, 2011

Export QTP Result as a HTML Page

The Quick Test Professional has an in built functionality to Export Test Results in PDF, Excel or HTML file but if the user want to Export the Test Result via descriptive programming and user defined function than the below code will be helpful.

This below simple code for "Export QTP Result as a HTML Page" is modifiable and developed with VB Script.

Function Declaration :
Public Function GenerateHTMLReport(ByVal inputXML, ByVal inputXSL, ByVal outputFile)
   sXMLLib = "MSXML.DOMDocument"
   Set xmlDoc = CreateObject(sXMLLib)
   Set xslDoc = CreateObject(sXMLLib)
   xmlDoc.async = False
   xslDoc.async = False

   xslDoc.load inputXSL

   xmlDoc.load inputXML

   outputText = xmlDoc.transformNode(xslDoc.documentElement)

   Set FSO = CreateObject("Scripting.FileSystemObject")
   Set outFile = FSO.CreateTextFile(outputFile,True)
   outFile.Write outputText
   outFile.Close
   Set outFile = Nothing
   Set FSO = Nothing
   Set xmlDoc = Nothing
   Set xslDoc = Nothing
   Set xmlResults = Nothing

 End Function

Use of Function :
Dim sResultsXML, sDetailedXSL
sResultsXML is for define full path of the Result.xml file.
sDetailedXSL is for QTP inbuilt PDetails.xsl file for format the Result.xml file.

For Example :
sResultsXML = "C:\Temp\TempResults\Report\Results.xml"
sDetailedXSL = "C:\Program Files\HP\QuickTest Professional\dat\PDetails.xsl"

Function Call :
GenerateHTMLReport sResultsXML, sDetailedXSL, "Path for save the Exported HTML file"

Monday, October 3, 2011

Visual Studio 2011 and .NET Framework 4.5 developer

There is a Fantastic news from the Microsoft for developer because microsoft recently announced the Visual Studio 2011 and .NET Framework 4.5 developer preview in Anaheim, California. There are some new features at this movement with Visual Studio 2011 and .NET Framework 4.5 developer preview are as under

1.) Visual Studio 2011 developer preview Features

- Develop Metro style Apps for Windows 8
- Enhancements for Game Development
- Code Clone Analysis
- Code Review Workflow
2.) .NET Framework 4.5 developer preview Features

- State machine support in Windows Workflow
- Improved support for SQL Server and Windows Azure in ADO.NET
- ASP.NET has increased investments in HTML5, CSS3, device detection, page optimization, as well as new functionality with MVC4