HPQC and XLT – Integration Example

You have to work with HP Quality Center (HPQC), but you don’t want to execute all the test cases manually. You automated some tests using XLT Script Developer and like the outcome. You want to use the Script developer much more but you face one last problem: You still have to enter the test results manually into HPQC. This renders some of the test automation advantages useless.

The following example can mitigate that problem. HPQC offers an API called Quality Center Open Test Architecture API (OTA API).
Using this interface, you can set test results automatically.

This is the way to do it: Run the test cases as a Script Developer Batch Test, export the results, parse them and submit them to HPQC. Completely without touching the HPQC web interface at all.

The following Python command line script does the parsing and submitting:

The processed part of the Script Developer result file looks like this:

It needs to run in a Windows environment because it is importing win32com. You have to install:

  • Python (version 3 is needed)
  • pywin32 (Python for Windows extensions)
  • Beautiful Soup 4 (a HTML parser for Python) (after extracting the archive, cd into it and run ‘setup.py install’ to install it)

Now adjust the variables in the script and you are ready to go. The following screenshot depicts the parts of HPQC that the script is using.

In the first td there is the name of the test case (always starting with “Tests.”) and the second td contains the status of the test case.

Disclaimer: This is an example only. Use at your own risk.

The script has been inspired by Generating Custom Reports with Quality Center OTA using Python.