9.9. HP Quality Center™ Integration

Table of Contents

9.9.1. Integration Features
9.9.2. Installing the HP Quality Center™ Plugin
9.9.3. Configuring the HP Quality Center™ Plugin
9.9.4. Using the Integration From HP Quality Center
9.9.5. Importing test cases from the command line

This add-on package tightly integrates Squish with any HP Quality Center™ 10 and HP Quality Center™ 11 server. This allows Squish test cases and test suites to be imported into and executed from within HP Quality Center™. All that's necessary to make this work is an extra software package provided by froglogic which installs a plugin into your HP Quality Center™ server, making it aware of how to invoke Squish.

[Note]Separate Purchase

This add-on must be bought separately. Contact for details.

At the time of this writing, the add-on only supports HP Quality Center™ 10 and HP Quality Center™ 11—other HP Quality Center™ versions may or may not work.

9.9.1. Integration Features

Here is a quick overview what you can do once HP Quality Center™ is integrated with Squish:

  • Create new Squish test suites and test cases in any of the scripting languages supported by Squish.

  • Edit the Squish test cases' test scripts.

  • Run Squish tests on any host known to the HP Quality Center™.

  • Run arbitrary commands before and after each test case is run.

  • Inspect the results of a test run without having to start the Squish IDE.

  • Inspect the results of any previous Squish test runs, since all test run results are recorded in the HP Quality Center™'s database.

  • Import a set of Squish test cases and test suites in one go using a command line tool.

9.9.2. Installing the HP Quality Center™ Plugin

9.9.2.1. Common

We're including a step-by-step list of actions to take to install the plugin into HP Quality Center™ here. However, please note that these instructions might be slightly different in case you have a different HP Quality Center™ version. In case you hit problems, you can also refer to the official HP documentation by opening the Documentation Library from within HP Quality Center™, selecting the Custom Test Type Integration manual and then following the steps described in the Registering the Test Type chapter. The authoritative document on installing custom plugins is the one by HP.

[Warning]Temporary Shutdown

During the installation of the HP Quality Center™ plugin, the HP Quality Center™ server will be shut down, and then restarted. This means that users won't be able to connect to HP Quality Center™ for the short time it takes to complete the installation.

Note that the installation process only has to be done once, on the HP Quality Center™ server. The client desktops do not need anything done to them at all.

9.9.2.2. Installation for HP Quality Center™ 10

The following steps will use the placeholder <QCDIR> to refer to the directory where HP Quality Center™ is installed. On Solaris, this is usually /opt/qc, on Windows systems it's something like C:\Program Files\HP\HP Quality Center Starter Edition\QCStarter (for the HP Quality Center™ 10 Starter Edition).

  1. Create a working copy of the <QCDIR>\application\20qcbin.war directory into some temporary directory. For the following steps we will assume that the working copy is in C:\Temp\20qcbin.war

  2. Copy the following files into the C:\Temp\20qcbin.war\Install directory:

    • SquishTestType.lld

    • SquishExecConfiguration.xco

    • SquishScriptEditor.xco

    • SquishResultViewer.xco

    • squishremoteagent.xxx

    • MSCOMCTL.xco

    • QtCore4.lld

  3. Copy the file squishtest.cab into the C:\Temp\20qcbin.war\CustomTestTypes directory. If this directory doesn't exist, create it.

  4. If the file C:\Temp\20qcbin.war\custom_modules.cab exists, send it to ; this file must be modified, and it must be digitally signed afterwards. We will then send the modified file back to you. Otherwise, simply copy the file custom_modules.cab which is shipped with the plugin into C:\Temp\20qcbin.war.

  5. Shut down HP Quality Center™.

  6. Rename the directory <QCDIR>\application\20qcbin.war to <QCDIR>\application\20qcbin.war.bak.

  7. Copy the directory C:\Temp\20qcbin.war (which contains the modified files) to <QCDIR>\application\20qcbin.war.

  8. Rename the directory <QCDIR>\jboss\server\default\deploy\qcbin.war to <QCDIR>\jboss\server\default\deploy\qcbin.war.bak.

  9. Copy the directory C:\Temp\20qcbin.war to <QCDIR>\jboss\server\default\deploy\qcbin.war.

    [Note]Directory Renaming

    Note that the target directory is renamed to qcbin.war not 20qcbin.war

  10. Start HP Quality Center™ again. The plugin is now installed in the server and only needs to be registered in the list of test types, and described in the next steps.

  11. Log on to HP Quality Center™ and select Customize from the Tools menu.

    Tools Customize Menu
  12. Click Project Entities to open the Project Entities window.

  13. In the Project Entities list, expand the Test entity, expand the System Fields folder under it, and select Type.

    Select Type
  14. Click the Goto List button to open the Project Lists dialog box.

  15. Click the New Item button, and type the name SQUISH-TEST to add it to the list of test types.

    Add Squish Test Type

  16. Close the Project Lists dialog box, and click Save.

The SQUISH-TEST type is now added to the test type options. You can create froglogic Squish tests by creating new tests with the SQUISH-TEST type.

9.9.2.3. Installation for HP Quality Center™ 11 - Server

The following steps will use the placeholder <QCDIR> to refer to the directory where HP Quality Center™ is installed. On Windows systems it's something like C:\Program Files (x86)\HP\HP Application Lifecycle Management Platform (for the HP Quality Center™ 11).

  1. Create the directory <QCDIR>\application\20qcbin.war\Extensions if it doesn't exist yet.

  2. Copy the contents of the “Extensions” directory of the plugin ZIP file to <QCDIR>\application\20qcbin.war\Extensions - after this step, the file <QCDIR>\application\20qcbin.war\Extensions\SquishTest.cab should exist as well as the <QCDIR>\application\20qcbin.war\Extensions\Squish directory.

  3. Create the directory <QCDIR>\application\20qcbin.war\CustomTestTypes if it doesn't exist yet.

  4. Copy the file squishtest.ini from the plugin ZIP file to <QCDIR>\application\20qcbin.war\CustomTestTypes

  5. Execute the HP Server Deployment tool, either by selecting Programs|HP ALM Platform|Server Deployment Wizard in the Windows Start menu, or by executing the program <QCDIR>\bin\run_server_deploy_tool.bat

  6. After the deployment tool finished, log into the “Site Administrator” interface and select Tools|Update Test Types from the menu.

A new SQUISH-TEST test type is now registered in HP Quality Center™.

9.9.2.4. Installation for HP Quality Center™ 11 - Client

To run Squish tests on a client desktop the HP Quality Center Connectivity tool has to be run once.

  1. Login into “HP ALM - Quality Center 11

  2. Click Help|Add-ins Page

  3. Click HP Quality Center Connectivity

  4. Click Download Add-in

  5. Run the TDConnect.exe with administrator rights.

To run Squish tests on clients who don't have administrator rights, administrator rights are also required once to explicitly register the squishremoteagent.exe by running the command squishremoteagent.exe /regserver The squishremoteagent.exe can be found by default inside the directory %USERPROFILE%\Local Settings\Application Data\HP\ALM-Client\<qc_server>.

[Note]Note

If the squishremoteagent.exe is not registered you might see an error message like “Cannot activate Remote Execution server”.

Finally the redistributable package vcredist_x86.exe shipped with the plugin has to be installed.

[Note]Clients with no administrator rights

Administrator rights to install the HP Quality Center Connectivity Add-in and the squishremoteagent.exe are only required once even if the plugin is updated on the HP Quality Center™ server.

9.9.3. Configuring the HP Quality Center™ Plugin

[Note]Screenshots

The following screenshots are taken from HP Quality Center™ 10 but also apply for HP Quality Center™ 11 which has a different style.

After the plugin has been installed and registered, you will need to setup the initial configuration. You might also want to adjust and augment the configuration later on. How this is accomplished will be discussed in this section.

The configuration of the Squish integration plugin consists of two settings keys which are stored in the “Site Configuration” of your HP Quality Center™ server.

SettingDescription
SQUISH_SCRIPTING_LANGUAGE

Indicates the scripting language to be used when creating new Squish test cases within the HP Quality Center™. Can be “Python”, “Tcl” or “JavaScript”.

SQUISH_PATHS

This string in the format <hostname>=<path>, <hostname>=<path> tells the Squish plugin, where the Squish installation can be found on each of the hosts on which you intend to run the tests. <hostname> can be the name of a host (or an IP address of one) on which a test should be run. <path> stands for the path on which Squish is installed on the given host.

You can also use * as a host name, which is then used as a default in case a specific host is not listed.

An example entry which describes that on the host “TREBULUSSquish is installed in C:\Tools\Squish and on the host with the IP address 192.168.42.3 Squish is installed in E:\Deploy\Tools\Squish-Stable looks like this:

TREBULUS=C:\Tools\Squish,192.168.42.3=E:\Deploy\Tools\Squish-­Stable

You need to configure these entries before being able to execute Squish runs in the Site Configuration. In case they don't exist yet, you might have to add them. To do so, open the Site Administrator interface of HP Quality Center™, then click on the Site Configuration tab at the top of the screen to move to the site configuration screen. Here you can add and edit any keys.

Site Configuration

9.9.4. Using the Integration From HP Quality Center

9.9.4.1. Creating New Test Cases

Creating new Squish test cases within the HP Quality Center™ works virtually the same as creating any other kind of test. In the Test Plan module, create a new test folder called “froglogic Squish Tests”. In this folder, you can then create as many test folders as you want. (We recommend that each test suite folder name begins with the prefix “suite_”, since this is what the Squish IDE expects.)

Here's a quick rundown on how to create a new Squish test in HP Quality Center™.

  1. Log into the HP Quality Center™ project to which you want to add a test.

  2. Click on the button labeled Test Plan at the left side of the screen to move to the Test Plan module.

  3. In the tree view of the Test Plan module screen, open the froglogic Squish Tests folder. If it doesn't exist yet, create it using the New Folder button above the tree view.

  4. Right-click on the froglogic Squish Tests folder item to open the context menu. In the context menu, select New Test....

  5. In the dialog that shows up, select “SQUISH-TEST” from the combo box to indicate that you want to create a Squish test. Choose any name for the test you want, then press OK.

  6. In the Required Test Fields that now shows up, select any values which are appropriate for your organizational testing discipline. For this sample, choose any values you want (you can always change them later on), then press OK.

Congratulations, you just created a Squish test!

Since Squish tests always have at least one test script attached to them, you could now switch to the Test Script tab of the newly created test case to see the simple (mostly empty) test script.

9.9.4.2. Running Squish Tests

[Note]Screenshots

The following screenshots are taken from HP Quality Center™ 10 but also apply for HP Quality Center™ 11 which has a different style.

Executing this Squish test works like executing any other test which is stored in a HP Quality Center™ server: move to the Test Lab module by clicking on Test Lab on the left side of the screen, then drag the tests you want to execute into the execution grid. When you have assembled all the tests for a test run, press the Run button to run them.

Test Lab
[Note]squishserver Must be Running

Before running any tests the squishserver must be running. You could start the squishserver before using HP Quality Center™ and then stop it once you have finished creating and running your tests.

Executing a Squish test within HP Quality Center™ will cause the integration plugin to invoke squishrunner, much like the Squish IDE does internally. You might want to pass special arguments to squishrunner when executing the test though (for instance, you probably want to specify any additional wrapper libraries you want to use, and you will want to specify an application which to test).

You can also specify arbitrary commands to be executed before and/or after squishrunner is invoked. (See squishrunner (Section 7.4.3) for full details of squishrunner's command line options.)

To configure a Squish test run, right-click on the test in the test execution grid of the Test Lab, then select Test Instance Properties... in the context menu to open the dialog which presents all kinds of execution parameters. The Squish-specific settings are accessible by clicking on Configuration on the left side of the dialog, then clicking on the Automated tab.

Test Instance Properties

Setting the AUT name must be omitted if the test script uses the startApplication function. Also if the test script uses the testSettings.setWrappersForApplication function the setting Wrapper to use can be omitted too. So if the test script uses both functions and the test should be executed on the client desktop no configuration is required inside the Test Instance Properties.

Please note that even if the test should be executed on another host the option Run All Tests Locally has to be enabled as the squishrunner will always be executed on the client desktop.

Automatic Runner
[Note]Quota Control

If an HP Quality Center™ test run produces a “Server throws an exception” error, one possible cause is that the plugin has hit a quota limit when connecting to the HP Quality Center™ server. (Even a single user on a single machine will need at least two connections—one from the client to the server, and another between the plugin and the server.) To try to solve this problem, go to the HP Quality Center™'s Site Administration, select Site Projects and open the Project User Quota dialog. Inside the dialog check the Unlimited connections radio button, then click OK. Now try running the test again. If the problem has been solved you may wish to return to the Project User Quota dialog and experiment with a specific number of connections; or you can just leave it unlimited. (For more information on this topic see the Quality Center Admin Guide.)

User Quota

9.9.5. Importing test cases from the command line

9.9.5.1. The qcimporter.exe utility

The HP Quality Center™ integration also features a Windows command line tool called qcimporter.exe which can be used to import a batch of Squish test cases into HP Quality Center™ at once. For each imported test case, the name of the test (as it is stored in HP Quality Center™) as well as its ID number will be printed (e.g. in order to allow further operations on the test using the OTA API).

9.9.5.2. Installing the qcimporter.exe utility

The qcimporter.exe utility also requires that the HP Quality Center Connectivity tool has been run once. See Installation for HP Quality Center™ 11 - Client (Section 9.9.2.4) for the installations steps.

9.9.5.3. Synopsis

There are two ways to invoke the qcimporter.exe program:

qcimporter {--testsuite <directory>} [--globalscripts<directory>...] [--replace] [--prune] {--server <hostname>} [--serverport<port>] {--domain <name>} {--project <name>} {--user <name>} [--password <string>] [--path <path>]

This invocation, using the --testsuite switch, can be used to implement a complete Squish test suite to HP Quality Center™ in one go. This includes all test cases as well as shared scripts.

qcimporter {--testcase <directory>} [--objectmap <filename>] [--globalscripts<directory>...] [--attach-shared-folder] [--replace] [--prune] [--field <fieldname>=<value>...] [--attachment <filename>...] {--server <hostname>} [--serverport<port>] {--domain <name>} {--project <name>} {--user <name>} [--password <string>] [--path <path>]

This way of running the utility will upload just a single test case to HP Quality Center™. This allows you to attach different files to individual test cases, set custom fields on a single test case and it will print output in the form <testcasename>=<ID>. on the command shell.

The exact meaning of the individual arguments mentioned in the above synopses is as follows:

--testsuite <directory>

Indicates that a complete Squish test suite should be imported into HP Quality Center™. Takes the name of the directory in which the test suite is stored, e.g. C:\Squish\suite_mysuite. Either this switch or the --testcase argument must be given.

--testcase <directory>

Indicates that a single Squish test case should be imported into HP Quality Center™. Takes the name of the directory in which the test case is stored, e.g. C:\Squish\suite_mysuite\tst_login. Either this switch or the --testsuite argument must be given.

--globalscripts <directory>

Allows attaching global script folders to the test suite or test case. Takes the name of the directory in which the global scripts are stored, e.g. C:\global_scripts.

--attach-shared-folder

Attaches the test suites shared folder while importing a single test case. This switch is only valid if --testcase is used.

--replace

Replaces tests and test attachments if they exist in HP Quality Center™. To do a full synchronization of the imported test suite or test case both options --replace and --prune have to be specified.

--prune

Removes tests and test attachments in HP Quality Center™ if they don't exist inside the imported test suite or test case anymore. To do a full synchronization of the imported test suite or test case both options --replace and --prune have to be specified.

--objectmap <filename>

Allows attaching an object map file to a test case. The name of the object map file is expected as an argument to this switch, e.g. C:\suite_mysuite\objects.map. This switch is only valid if --testcase is used.

--field <name>=<value>

This switch can be used to set custom fields of the test cases being created in HP Quality Center™. See the Examples (Section 9.9.5.4) for examples of how to use this switch.

--attachment <filename>

Allows attaching arbitrary files to the test cases being uploaded.

--server <hostname>

This argument specifies the host at which HP Quality Center™ is running.

--serverport <port>

This argument specifies the port at which HP Quality Center™ is running. If omitted the qcimporter.exe utility will assume that the server is running on port 8080 (the default).

--domain <name>

Specifies the domain of the project into which the test cases should be uploaded.

--project <name>

Specifies the name of the project in which the test cases should be created.

--user <name>

Defines the name of the user as which the utility should log into HP Quality Center™.

--password <string>

Defines the password to be used when logging into HP Quality Center™. You may omit this argument in case the password is empty.

--path <path>

Allows specifying the folder in the subject tree of the HP Quality Center™ test plan within which the test cases should be created. If this argument is omitted, a folder called froglogic Squish Tests will be created at the root of the subject tree.

In case the --testsuite switch was given, a folder with the name of the test suite (e.g. suite_mysuite will be created below the given path).

The <path> is a list of folder names separated by forward slashes. See the Examples (Section 9.9.5.4) for a sample path.

9.9.5.4. Examples

Here are various sample invocations of the qcimporter.exe utility, showcasing the aforementioned switches.

  • Importing a complete test suite to the Quality Center server running on the host einstein:

    qcimporter --testsuite C:\Squish\suite_mysuite --server einstein --domain AcmeDomain --project SampleProject --user alex --password xyzzy
    

  • Importing a single test case, and attaching two files to it:

    qcimporter --testcase C:\Suites\suite_office\tst_login --server einstein --domain AcmeDomain --project SampleProject --user bob --password frog --attachment C:\firstattachment.txt --attachment C:\anotherattachment.ini
    

  • Importing a single test case and setting the custom TS_DESCRIPTION field:

    qcimporter --testcase S:\suite_webapp\tst_adduser --server pc0124 --domain Web --project WebSale --user alice --password al1ce --field "TS_DESCRIPTION=This is the description"
    

  • Importing a single test case into a custom location in the subject tree, using the --path switch:

    qcimporter --testcase C:\Suites\suite_office\tst_login --server einstein --domain AcmeDomain --project SampleProject --user bob --password frog --path "Our Suites/Business/New Test Cases"
    

    This will put the test tst_login into the folder New Test Cases, which is stored in the folder Business, which in turn is stored in the folder Our Suites.