How to integrate UFT(QTP) with ALM (Quality Center)

  • ALM allows integration with other HP products such as HP UFT and Hp Load Runner.
  • HP UFT is a functional automation tool that supports automation of both windows based and web based application. It also supports multiple technologies such as .NET, Java, Siebel, SAP etc.
  • In this section we will understand how to drive UFT scripts from ALM. It consists of various configurations and steps.
  • Prerequisite for this module is that both ALM and UFT must have been installed.

Following is the roadmap one needs to follow in oder to run UFT tests using ALM

integrate UFT(QTP) with ALM

Part A – Add-in Installation

Step 1) Navigate to the ALM landing page (http://localhost:8181/qcbin/) and select ‘Tools’ as shown below.

Add-in Installation

Step 2) The Add-in page and ‘HP ALM connectivity’ link should be clicked.

Add-in Installation

Step 3) Click ‘Download HP ALM Connectivity’ link and the exe file would be downloaded in the specified location.

Add-in Installation

Step 4) Right click the downloaded file and ‘Run as Administrator’.

Add-in Installation

Step 5) There won’t be any installation wizard that the user has to go through if UFT is preinstalled. User only receives the installation status as shown below.

Add-in Installation

Part B – Connecting UFT and ALM

Step 1) Open UFT and you will notice the presence of ALM as one of the menus as shown below.

Connecting UFT and ALM

Step 2) Navigate the ALM menu and select ALM connection.

Connecting UFT and ALM

Step 3) ALM connection dialog opens.

  1. Enter the ALM server URL
  2. Enter the UserName
  3. Enter the Password and click ‘Connect’

Connecting UFT and ALM

Step 4) Upon successful authentication, the ALM files would be downloaded as we are establishing connection between ALM and UFT for the very first time.

Connecting UFT and ALM

Step 5) The ALM connection dialog waits for the user to select the domain and project.

  1. Select Domain
  2. Select the project
  3. Click ‘Login’

Connecting UFT and ALM

Step 6) The ALM connection dialog displays the status.

  1. Connected to the Server and lists the details about the server address and user name.
  2. Connected to the project and lists the details about the project.
  3. Click ‘Close’

Connecting UFT and ALM

Part C – Saving Script into ALM

  • Let us understand the various components that are required for Executing an UFT Script.
  • Main Driver Script – The Entry point for any UFT Script that has .mts extension.
  • Library – The relevant Script/Function Files that can either be of extension (.vbs) or (.qfl).
  • Object Repository – It is usually of Shared Object repository by nature and has .tsr extension.
  • DataTable – Used for parameterizing the tests. Usually an Excel file.

Note: The Idea behind this chapter is to understand ALM and UFT integration and NOT to learn how to write UFT scripts.

Saving Script into ALM

Step 1) First step is to save the Main Driver Script into ALM from UFT. Navigate to ‘File’ Menu and choose ‘New Test’ as shown below.

Saving Script into ALM

Step 2) The New Test Dialog opens.

  1. Select the type of test.
  2. Enter the Name of Test.
  3. We need to choose the location as ALM (by default it would display the UFT installed location). Click on ‘Browse’ Button.

Saving Script into ALM

Step 3) The ‘Select Location’ Dialog opens up.

  1. Choose ‘ALM Test Plan’ Tab.
  2. Double Click ‘Functional‘ folder to open its subfolders.

Saving Script into ALM

Step 4) The ‘Select Location’ Dialog opens up with the subfolders of ‘Functional‘ Folder.

  1. Double Click ‘Automation folder.
  2. Click ‘Select’.

Saving Script into ALM

Step 5) The ‘New Test’ Dialog is displayed back to the user

  1. With the selected test location pointing to ALM.
  2. Click ‘Create’.

Saving Script into ALM

Step 6) Now let us verify if the test has created successfully by logging into ALM.

Navigate to ‘Test Plan’ Module.

  • You will notice that the test script ‘Guru99_Bank_Auto’ is created under ‘Automation’ folder.
  • Under details tab, we can also find that the test type is locked down as ‘QUICKTEST_TEST’ which means it is an UFT script.

Saving Script into ALM

Step 7)Now start developing the Script in UFT and save the script which can be accessed in ALM by selecting ‘Test Script’ Tab of the created test.

Saving Script into ALM

Step 8) Next step is to save the associated function library files under ‘test resources’ module of ALM which would be picked up automatically during execution.

For this script, we have two function libraries associated with the created test script out of which one contains all functions related to the application and one which contains function which will help the users to generate the output text result file.

Saving Script into ALM

Step 9) We need to save the associated library files in ALM under ‘test Resources’.

  • Click ‘New Resource’ button
  • The ‘New Resource’ Dialog opens up
  • Enter the Name of the Function Library
  • Select the type as ‘Function Library’
  • Click ‘OK’

Saving Script into ALM

Step 10) The created test resource will be displayed to the user as shown below.

Saving Script into ALM

Step 11) Now we need to upload the .vbs onto the created test resource.

  • Click ‘Resource Viewer’
  • Click ‘Upload File’

Saving Script into ALM

Step 12) The upload file dialog opens up.

  • Select the Path where the .vbs file is located
  • Select the File that has to be uploaded.
  • Click ‘Open’.

Saving Script into ALM

Step 13) Upon uploading successfully, ALM displays the status to the user. Click ‘OK’.

Saving Script into ALM

Step 14) The uploaded test resource can be viewed using ‘Resource Viewer’.

Saving Script into ALM

Step 15) Repeat the steps 8 to 14 to upload one other function file associated with the test. After uploading the ‘generateresult.vbs’, the resource viewer would be displayed as shown below.

Saving Script into ALM

Step 16) Now we need to upload the relevant ‘Object Repository’ files under ‘test resources’ module, similar to how we have uploaded function libraries.

  1. Click ‘New Resource’ Module
  2. The ‘New Resource’ Module window opens up.
  3. Enter the Name of the test resource.
  4. Select the type of the file as ‘Object Repository’.
  5. Click ‘OK’

Saving Script into ALM

Step 17) The Test resource is created as shown below. Now user needs to upload the repository file.

  • Click ‘Resource Viewer’ Tab.
  • Click ‘Upload File’ Button.

Saving Script into ALM

Step 18) Now upload the shared object repository file.

  • Select the File where it has been stored.
  • Click ‘Open’ button.

Saving Script into ALM

Step 19) Upon uploading successfully, ALM displays the status to the user. Click ‘OK’.

Saving Script into ALM

Step 20) The test resource can be viewed right from ALM as shown below.

Saving Script into ALM

Step 21) The last test resource that we need to upload is the ‘Test Data’ Sheet which contains the parameterized test.

For Demo purposes, we have automated 4 tests cases. The designed Test data is shown as below. Now we need to upload the same in ALM.

Saving Script into ALM

Step 22) Create a new resource with name ‘TestData’ and select the type as ‘test Resource’ and select ‘OK’

Saving Script into ALM

Step 23) As explained from step 17 to 19,uploadthe test data Excel file and uponsuccessful upload the Created ‘test data’ would be displayed as shown below.

Saving Script into ALM

Part D – Settings in UFT

Step 1) We have all the associated files loaded into ALM, we have to ensure that the automation script picks up the library file, OR and data file from ALM. Let us understand how to associate function libraries to the test script dynamically from ALM.

Settings in UFT

Step 2) The Object Repository also has to be picked up from ‘Test Resources’ Tab of ALM. Let us see how to load the Object repository dynamically during runtime.

Settings in UFT

Step 3) The Test Data has to be imported into the ‘Global’ Sheet of UFT. To perform the same we should ensure that we have the following piece of code before making an attempt to access the parameters mentioned in the data table.

Settings in UFT

Step 4) We Should ensure that we allow other HP products to interact with UFT. To perform the same, goto ‘Tools’ -> ‘Options’ as shown below.

Settings in UFT

Step 5) The Options Dialog opens up.

  • Select ‘GUI Testing‘ Tab.
  • Select ‘Test Runs’
  • Enable ‘Allow other HP products to run tests and components’
  • Click ‘OK’

Settings in UFT

Part E – Executing Scripts in ALM

Step 1) Create a test suite in ‘Test Lab’ Module for execution. Let us create a ‘New Folder’ for automated test suite.

  • Select the ‘Test Lab’ Module
  • Select the folder under which we like to create the new folder
  • Click on New folder icon
  • Enter the name of the folder
  • Click OK.

Executing Scripts in ALM

Step 2) New Folder would be created as shown below:

Executing Scripts in ALM

Step 3) Now we need to create a test set under the created folder.

  • Select the folder
  • Click ‘New Test Set’ button
  • Enter the Name of the Test Set
  • Click ‘Ok’

Executing Scripts in ALM

Step 4) Like manual tests, after creating the test set, the test instances need to be added from Test Plan tree.

  • Select the created test set
  • Click ‘Select Tests’ button. The Test Plan tree opens up.
  • Select the test
  • Click ‘<=’ button

Executing Scripts in ALM

Step 5) The added test would be displayed as shown below.

  • The added test displays the type of test as ‘QUICKTEST_TEST’ automatically.
  • Click ‘Run’ Button to trigger the execution.

Executing Scripts in ALM

Step 5) The automatic test runner dialog opens up. Let us understand all the available features within this window.

  • Run all – Allows us to execute the test set completely.
  • Run – Allows us to execute only the selected test instance.
  • Run all tests Locally – The test would be kicked off in the local host. If Unchecked user has the capabilities to enter to host name in which the tests has to be executed.
  • Enable Log – Creates an execution log file during the test run. To view the execution log after text execution, Select ‘View Execution‘ from ‘Run’ menu of the same dialog.

Click ‘Run’ to trigger the test.

Executing Scripts in ALM

Step 6) UFT will be launched in the background while the script is being executed. The run status will be displayed once the test execution is completed as shown below. Close the window.

Executing Scripts in ALM

Part F – Analyzing the Results

Step 1) The execution grid is displayed back to the user upon closing the ‘Automatic Runner’ dialog.

  • With test execution status updated.
  • The inbuilt UFT test report can be accessed by clicking the ‘Launch Report’ button.

Analyzing the Results

Step 2) The inbuilt UFT test report will be shown to the user.

Analyzing the Results

Step 3) The detailed results can be accessed using ‘Test Runs’ module. Like manual tests, the detailed result displays all the information.

Analyzing the Results

Step 4) The test also generates a text result file which can accessed from the attachments section. The text file is generated by the script(test framework) which is NOT the inbuilt report of UFT. To access the same perform the following:

  • Select the ‘Run ID’.
  • The ‘Run details’ dialog opens up.
  • Goto ‘Attachments’ Section.
  • A result file will be available for the users to download. Double click on the text file.

Analyzing the Results

Step 5) The text result file is opened in notepad. The result file will be displayed as shown below.

Analyzing the Results

Download the UFT automation script used in this tutorial

Video on QTP integration with Quality Center

Click here if the video is not accessible

Notes:-

  • Quality Center provides many a features like copying test steps , emailing scripts for review , adding attachments etc. to facilitate faster development of test cases.
  • You can create a script in Automation tools like QTP and Loadrunner , and then upload and store them in Quality Center
  • You can also directly convert a Manual Test Script in Quality Center into an Automated Script.