Techno Logica


Friday, November 28, 2008

VMware Lab Manager Add-in For HP Quality Center

The VMware Lab Manager Add-in for HP Quality Center provides an automation bridge between testing and deployment of test environments. QA staff now have the power to seamlessly invoke operations in VMware Lab Manager as part of a Test Set within HP Quality Center or from QuickTest Professional. Test Sets can now deploy variations of applications under test in a virtualized environment and direct other testing tools such as QuickTest Professional and WinRunner to run against them. When defects are encountered, the Add-in facilitates the creation of LiveLinks to capture the running state of the application when it failed. When the tests are finished running, the Add-in can undeploy the virtualized environment to save memory and processing resources.For More Details : Visit - http://www.genilogix.com/solutions/vmware.aspx

Also See : 

HPRead HP's executive brief on virtualization

View the HP/VMware/Genilogix webcast on Performance Testing Virtualized Applications

Thursday, November 20, 2008

Loading Custom QuickTest Professional Add-in When Starting Test From Quality Center

Whenever QuickTest Professional (QTP) is launched from Quality Center (QC), QTP is launched with the default addin ... that is Web Addin (mostly). This can be modified. There is a Template that QC launches which has this addin configured. So Modify the QuickTest Professional Add-in template test to your Addin Settings.

Here are the steps you will need to follow to modify the QTP add-in template test:
1. Launch QTP without connecting to QC.
2. Open up the relevant template from the file system. For example, if you are using QTP 9.1, you need to open up: "\Program Files\Mercury Interactive\QuickTest Add-in for Quality Center\bin\Templates\Template91". You will notice that the last two digits of the script name conform to the version of your QTP. 
3. Once opened, go to File->Settings. 
4. In the Properties tab, click the Modify button and add the relevant add-ins.
5. Apply the changes and save the script. All your generated scripts from QC will now include those add-ins. 

Tuesday, October 21, 2008

Quality Center Login Page - Using HTML & VBScript

Quality Center Login Page - Using HTML & VBScript


Quality Center - Login
QC Url
UserName
Password
Domain
Project
mail to: sunny.deb@gmail.com | http://technologicaguru.blogspot.com




Check out the file : QCDemo.html
Right-Click and View the Source.

Thursday, October 9, 2008

QTP Programming - Set & Remove Environment Variables

The Below Code Sets Environment Variables:

Dim
objWshShell, WshEnv, strEnvName, strEnvValue

strEnvName = "User_Name"
strEnvValue = "Sunny"

' create the WScript.Shell object
Set objWshShell = CreateObject("WScript.Shell")

' access the User Environment property
Set WshEnv = objWshShell.Environment( "User" )

' create and set the custom variable
WshEnv( strEnvName ) = strEnvValue


Remove a specified User environment variable

' access the User Environment property
WshEnv.Remove sVarName

Test Automation Life Cycle

Wednesday, September 24, 2008

QuickTest Automation Object Model

What is the QuickTest Automation Object Model?

An object model is a structural representation of software objects (classes) that comprise the implementation of a system or application. An object model defines a set of classes and interfaces, together with their properties, methods and events, and their relationships.

Essentially all configuration and run functionality provided via the QuickTest interface is in some way represented in the QuickTest automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in QuickTest have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods.

You can use the objects, methods, and properties exposed by the QuickTest automation object model, along with standard programming elements such as loops and conditional statements to design your script.

Automation scripts are especially useful for performing the same tasks multiple times or on multiple tests or components, or quickly configuring QuickTest according to your needs for a particular environment or application.

The QuickTest automation object model exposes the objects shown in the diagram below.
You can use these objects, and their associated methods and properties, to write
programs that automatically configure QuickTest options and run tests.



The QuickTest Professional application object.

When designing and running QuickTest automation scripts in a tool that supports the loading of type libraries for editing and running scripts, you can use the new operator to load the QuickTest type library before creating the QuickTest Application object.

Syntax:

Dim app as Application
Set app=new Application

or, if other type libraries are loaded in your tool, specify the QuickTest type library as follows:

Dim app as QuickTest.Application
Set app=new QuickTest.Application

When designing or running QuickTest automation scripts in a tool that does not support the loading of type libraries, use the CreateObject() function to create the QuickTest Application object.

Syntax:

Set app = CreateObject("QuickTest.Application")



You can create only one instance of this object. Use this object to return other QuickTest objects and to perform application level operations such as loading add-ins, creating or opening tests, and launching or closing the QuickTest application.

Open QuickTest and Connect to Quality Center

'**********************************************************************************
'Description:
'
'This example connects to a Quality Center project, opens a test (checks it out, if applicable),
'updates the Active Screen values and test object descriptions, and, if applicable,
'checks the modified test back into the Quality Center project.
'
'Assumptions:
'The test1 test is not already checked out.
'There is no unsaved test currently open in QuickTest.
'For more information, see the example for the Test.SaveAs method.
'When QuickTest opens, it loads the add-ins required for the test.
'For more information, see the example for the Test.GetAssociatedAddins method.
'**********************************************************************************


Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtUpdateRunOptions 'As QuickTest.UpdateRunOptions
' Declare an Update Run Options object variable
Dim qtRunResultsOptions 'As QuickTest.RunResultsOptions
' Declare a Run Results Options object variable
Dim blsSupportsVerCtrl ' Declare a flag for indicating version control support


Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

' Make changes in a test on Quality Center with version control
qtApp.TDConnection.Connect "http://tdserver/tdbin","MY_DOMAIN", "My_Project", "James", "not4you", False ' Connect to Quality Center

If qtApp.TDConnection.IsConnected Then ' If connection is successful
blsSupportsVerCtrl = qtApp.TDConnection.SupportVersionControl ' Check whether the project supports vervion control
qtApp.Open "[QualityCenter] Subject\tests\test1", False ' Open the test
If blsSupportsVerCtrl Then ' If the project supports version control
qtApp.Test.CheckOut ' Check out the test
End If

' Prepare the UpdateRunOptions object
Set qtUpdateRunOptions = CreateObject("QuickTest.UpdateRunOptions") ' Create the update Run Options object
' Set the Update Run options: update the Active Screen and test object descriptions. Do not update checkpoint values
qtUpdateRunOptions.UpdateActiveScreen = True
qtUpdateRunOptions.UpdateCheckpoints = False
qtUpdateRunOptions.UpdateTestObjectDescriptions = True

' Prepare the RunResultsOptions object
Set qtRunResultsOptions = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtRunResultsOptions.ResultsLocation = "" ' Set a temporary results location

'Update the test
qtApp.Test.UpdateRun qtUpdateRunOptions, qtRunResultsOptions ' Run the test in Update Run mode
qtApp.Test.Description = qtApp.Test.Description & vbNewLine & "Updated: " & Now ' Document the update in the test's description (Test Settings > Properties tab)

qtApp.Test.Save ' Save the test

If blsSupportsVerCtrl And qtApp.Test.VerCtrlStatus = "CheckedOut" Then ' If the test is checked out
qtApp.Test.CheckIn ' Check it in
End If

qtApp.TDConnection.Disconnect ' Disconnect from Quality Center
Else
MsgBox "Cannot connect to Quality Center" ' If connection is not successful, display an error message.
End If

qtApp.Quit ' Exit QuickTest
Set qtUpdateRunOptions = Nothing ' Release the Update Run Options object
Set qtRunResultsOptions = Nothing ' Release the Run Results Options object
Set qtApp = Nothing ' Release the Application object


QuickTest Professional Automation - Test Object

Open a Test

'**********************************************************************************
'Description:
'
'This example opens QuickTest without any add-ins loaded
'(standard Windows support only) and specifies the applications
'to be opened for the test.
'
'Assumptions:
'There is no unsaved test currently open in QuickTest.
'For more information, see the example for the Test.SaveAs method.
'**********************************************************************************

Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtStdLauncher 'As QuickTest.StdLauncher ' Declare an Windows Applications launcher variable
Dim qtStdApp 'As QuickTest.StdApplication ' Declare as StdApplication object variable
Dim strAdded ' Declare a string variable for the added applications

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object

' Preparare application and test
qtApp.SetActiveAddins Array() ' Remove all add-ins from the collection so that QuickTest opens with no add-ins loaded
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible
qtApp.Test.SetAssociatedAddins Array() ' Remove all add-ins from the test's associated add-ins list.
Set qtStdLauncher = qtApp.Test.Settings.Launchers.Item("Windows Applications") ' Return the Windows Applications launcher

qtStdLauncher.Active = True ' Instruct QuickTest to open applications when the record session begins

' Set the applications under test
qtStdLauncher.Applications.AddApplication "C:\Viewer.exe", "C:\" ' Add an application
qtStdLauncher.Applications.AddApplication "D:\Apps\Editor.exe", "D:\Apps" ' Add another application

' Save changes and clean up
qtApp.Test.SaveAs "C:\Tests\NewTest" ' Save the test
qtApp.Quit ' Exit QuickTest
Set qtStdLauncher = Nothing ' Release the Windows Applications launcher object
Set qtApp = Nothing ' Release the Application object


Run a Test

'**********************************************************************************
'Description:
'
'This example opens a test, configures run options and settings,
'runs the test, and then checks the results of the test run.
'
'Assumptions:
'There is no unsaved test currently open in QuickTest.
'For more information, see the example for the Test.SaveAs method.
'When QuickTest opens, it loads the add-ins required for the test.
'For more information, see the example for the Test.GetAssociatedAddins method.
'**********************************************************************************

Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

' Set QuickTest run options
qtApp.Options.Run.ImageCaptureForTestResults = "OnError"

qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False

qtApp.Open "C:\Tests\Test1", True ' Open the test in read-only mode

' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Settings.Run.IterationMode = "rngIterations" ' Run only iterations 2 to 4
qtTest.Settings.Run.StartIteration = 2
qtTest.Settings.Run.EndIteration = 4
qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs

Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = "C:\Tests\Test1\Res1" ' Set the results location
qtTest.Run qtResultsOpt ' Run the test

MsgBox qtTest.LastRunResults.Status ' Check the results of the test run
qtTest.Close ' Close the test

Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object

Friday, March 28, 2008

Quality Center Open Test Architecture API -OTA COM 9.0

Component Object Model (COM) is a software architecture that allows the components made by different software vendors to be combined into a variety of applications. COM defines a standard for component interoperability, is not dependent on any particular programming language, is available on multiple platforms, and is extensible.
It is used to enable inter-process communication and dynamic object creation in any programming language that supports the technology.
COM Automation allows users to build scripts in their applications to perform repetitive tasks or control one application from another.

The family of COM technologies includes

– COM+
– Distributed COM (DCOM) and
– ActiveX® Controls.



Quality Center Open Test Architecture API -OTA COM 9.0


The Quality Center Open Test Architecture API is a COM library that enables you to integrate external applications with Quality Center. It is naturally and easily used with Microsoft Visual Basic, and the syntax and examples in this reference use Visual Basic. The examples in this project were developed with Microsoft Visual Basic 6.0 and are not necessarily valid under other development platforms.

The OTAClient.dll (OTA COM 9.0 Type Library) is downloaded to the following folder:
\Program Files\Common Files\Mercury Interactive\Quality Center


Quality Center Object Model


Component Object Model (COM) – Overview


Function to Connect to QC using the OTA API Methods

Private Function makeConnection(ByVal qcHostName$, qcDomain$, qcProject$, qcUser$, qcPassword$, Optional qcPort) As Boolean
'------------------------------------------------------------------------
' This routine makes the connection to the gobal TDConnection object,
' declared at the project level as Global tdc as TDConnection,
' and connects the user to the specified project.
'-----------------------------------------------------------------------

Dim qcServer As String
Const fName = "makeConnection" 'For error message

On Error GoTo makeConnectionErr
errmsg = ""

'Construct server argument of format "http://server:port/qcbin"
qcServer = "http://" & qcHostName

If Not (IsMissing(qcPort)) Then
If Len(qcPort) > 0 Then qcServer = qcServer & ":" & qcPort
End If
qcServer = qcServer & "/qcbin"

''Check status (For illustrative purposes.)
' 'MsgBox tdc.LoggedIn 'Error: OTA Server is not connected
' MsgBox tdc.Connected 'False
' MsgBox tdc.ServerName 'Blank string
'Create the connection
errmsg = "Failed to create TDConnection"
If (tdc Is Nothing) Then Set tdc = New TDConnection
If (tdc Is Nothing) Then GoTo makeConnectionErr
errmsg = ""
tdc.InitConnectionEx qcServer
''Check status.
' MsgBox tdc.LoggedIn 'False
' MsgBox tdc.Connected 'True
' MsgBox tdc.ServerName 'http:///qcbin/wcomsrv.dll

'Log on to server
tdc.Login qcUser, qcPassword
''Check status.
' MsgBox tdc.LoggedIn 'True
' MsgBox tdc.ProjectName 'Empty String
' MsgBox tdc.ProjectConnected 'False
' Connect to the project and user
tdc.Connect qcDomain, qcProject
' MsgBox tdc.ProjectName 'qcProject
' MsgBox tdc.ProjectConnected 'True
' Exit status
makeConnection = SUCCESS
Exit Function

makeConnectionErr:
ErrHandler err, fName, err.Description & vbCrLf & errmsg
makeConnection = FAILURE

End Function


Using the Quality Center Open Test Architecture API methods and classes one can automate and customize the actions of Quality Center like Execute TestSets, Execute Tests, Get Execution Status, Get or Set Requirements, Get or Set Test Design Steps or Attachments and many more actions in Quality Center.



API References:

· Mercury Quality Center Open Test Architecture API Reference

· Mercury Quality Center Site Administration API Reference

Note: Right-Click on the File and Click "Unblock"

NOTE:
If you want to know what is the reference for the TDAPIOLE you have to go to the regedit, "HKEY_CLASSES_ROOT\TDApiOle.TDConnection\CurrVer" and see what is the current version and use it.

HP QuickTest Professional - Functional & Regression Testing Tool

HP QuickTest Professional - Functional & Regression Testing Tool

HP QuickTest Professional software is advanced,automated testing software for building functional and regression test suites. It captures, verifies and replays user interactions automatically and helps testers quickly identify and report on application effects, while providing advanced functionality for tester collaboration.

Simplify test creation and maintenance
HP QuickTest Professional software provides functional and regression test automation for major software applications and environments, including next-generation development technologies, such as Windows® Presentation Foundation, web services, Macromedia Flex, .NET, J2EE and ERP, and CRM applications.
HP QuickTest Professional offers a fresh approach to automated testing: it deploys the concept of keyword-driven testing to radically simplify test creation and maintenance. Using keyword capabilities, your testers can build test cases by capturing flows directly from the application screens and applying robust capturing
technology (record/replay). In addition, your power users get full access to the underlying test and object properties through an integrated scripting and debugging environment that is synchronized with the Keyword View capability for your complete testing cycle.

With HP QuickTest Professional, your Quality Assurance (QA) organization can:
• Empower the entire team to create sophisticated test suites with less training
• Establish correct functionality across all environments, data sets and business processes
• Fully document and replicate defects for developers, helping them fix defects faster and meet production deadlines
• Easily regression test ever-changing applications and environments
•Deliver quality products and services and improve revenues and profitability
• Enable tester workgroups to share automated testing assets across teams




HP Mercury Quick Test Professional 9.5



The New version of QTP has some new features in it. They are :

Improvements to the Installation Process - QTP 9.5 incorporates several improvements to the installation process. The most dramatic change is offering an all-in-one install for all the supported environments delivered on a single DVD. Coupled with an all-in-one license option, this simplifies the installation process considerably. However, the financial implications of such an all-in-one license are still left to be seen (though previous add-in specific licenses will still work).

New Design-Time Panes - QTP 9.5 continues the theme QTP 9.0 established in putting a massive emphasis on smoothing the user experience and reducing the click-per-action ratio. Operations which were once buried under endless sub-menus, or had no automated interface at all, are now placed front-and-center via the new IDE panes. While the new panes do not deliver any new functionality per-se (aside from the Process Guidance pane), they have the potential to dramatically change the way you generate and maintain your code.

The Object Repository - The first difference noticed when the Local object repository or the Repository manager are opened is the new "Checkpoint and Output Objects" branch in the treeview on the left.

Mercury Screen Recorder - Captures your entire run session in a movie clip or capture only the segments with errors, and then view your movie from the Test Results window.

Dynamic Management of Object Repositories- Programmatically manage an action's shared object repository collection during the test run.

HP WinRunner - Functional Testing software

HP WinRunner software is standard, functional testing software for enterprise IT applications. It captures, verifies and replays user interactions automatically, so you can identify defects and determine that your business processes work as designed.

HP WinRunner’s intuitive recording process helps you produce robust functional tests. To create a test, HP WinRunner simply records a typical business process by emulating user actions, such as ordering an item or opening a vendor account. During recording, you can directly edit generated scripts to meet the most complex test requirements. Next, testers can add checkpoints, which compare expected and actual outcomes from the test run. HP WinRunner offers a variety of checkpoints, including test, GUI, bitmap and web links. HP WinRunner can also verify database values to determine transaction accuracy and database integrity, highlighting records that have been updated, modified, deleted and inserted. With a few mouse clicks, the DataDriver Wizard feature lets you convert a recorded business process into a datadriven test that reflects the real-life actions of multiple users. For further test enhancement, the Function Generator feature presents a quick and reliable way to program tests, while the Virtual Object Wizard feature lets you teach HP WinRunner to recognize, record and replay any unknown or custom object. As HP WinRunner executes tests, it operates the application automatically, as though a real user were performing each step in the business process. If test execution occurs after hours or in the absence of a quality assurance (QA) engineer, the Recovery Manager and Exception Handling mechanisms automatically troubleshoot unexpected events, errors and application crashes so that tests can complete smoothly. Once tests are run, HP WinRunner’s interactive report - ing tools help your team interpret results by providing detailed, easy-to-read reports that list errors and their originations. HP WinRunner lets your organization build reusable tests to repeat throughout an application’s lifecycle. Thus, if developers modify an application over time, testers do not need to modify multiple tests. Instead, they can apply changes to the Graphical User Interface (GUI) Map, a central repository of test-related information, and HP WinRunner automati - cally propagates changes to all relevant scripts.

NOTE: On February 15, 2008, HP Software announced the end–of–support for HP WinRunner versions 7.5, 7.6, 8.0, 8.2, 9.2—all versions, all editions.

Wednesday, January 2, 2008

Connect to Quality Center using Scripting

To Connect QC from QTP using VB Script

Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True
qtApp.TDConnection. Connect "URL", "DOMAIN", "PROJECT", "USERNAME", "PASSWORD", False

To get test name from quality center:

Set td=createobject("TDApiOle80.TDConnection.1")
td.InitConnectionEx "http://qc/qcbin"
td.ConnectProjectEx "DOMAIN", "PROJECT","USERNAME", "PASSWORD"
Set tstMgr = td.TreeManager
Set tsttr = tstMgr.NodeByPath("subject\functionality\SUB FOLDER NAME")
Set tsetFact = tsttr.TestFactory
Set tsetList = tsetFact.NewList("")
For Each tset in tsetList
Msgbox ("Test Name = " & tset.Name)
Next


To Find a particular the TestSet from QC :

Dim txtTestSet as String
txtTestSet = "TestSet_01"
Dim tset
tdc = New TDAPIOLELib.TDConnection
tdc.InitConnectionEx("http://server/qcbin")
tdc.Login("usrid", "pwd")
tdc.Connect("DOMAIN", "Project")
Dim tstMgr = tdc.TestSetTreeManager
Dim tsttr = tstMgr.NodeByPath("Root\SubFolder")
Dim tsetFact = tsttr.TestSetFactory
Dim tsetList = tsetFact.NewList("")
For Each tset In tsetList
If LCase(Trim(tset.Name)) = LCase(Trim(txtTestSet)) Then
MsgBox("Test Set Found")
End If
Next

NOTE : TDApiOle80 is for QC 8.0
TDAPIOLELib is for QC 9.0