Generating VAPI-XP scripts with HP Quality Center

If you are running VAPI-XP tests in HP Quality Center, you can generate VAPI-XP script from HCL OneTest™ API that you can use to create tests in Quality Center.

Before you begin

Install HCL OneTest™ API on the Quality Center client machine to enable the execution of HCL OneTest™ API test resources.

About this task

Follow the steps to generate a VAPI-XP script from HCL OneTest™ API:

Procedure

  1. Select Generate External Tool Configuration from the Tools menu.

    The Generate External Tool Configuration wizard is displayed.

  2. On the Configuration type and environment page, select VAPI-XP JavaScript for executing tests or suites in HP Quality Center. Select the existing HCL OneTest™ API environment in which the selected resources are to be run. Click Next.

    The Select resources page is displayed with the project resource tree.

  3. In the Test Executor field, enter the path to the RunTests command which is used by Quality Center to execute the selected resource. By default, this field is populated according to the HCL OneTest™ API installation location. If you change the value, be sure to point it to a RunTests executable that is located in an installation directory of HCL OneTest™ API or HCL OneTest API Agent. If you want to have Quality Center raise defects automatically in the case of a failed execution, select the Raise defects automatically check box.

    The Summary page is displayed with the contents of the script.

  4. Click Browse to select a location and name for the VAPI-XP script.
    Note: If the file name you select is already in use, HCL OneTest™ API does not overwrite an existing file. You can use a modified file name, or you can cancel and enter a new name.
    Following is an example VAPI-XP script generated by HCL OneTest™ API:
    // ----------------------------------------------------
    // Main Test Function
    // Debug - Boolean. Equals to false if running in [Test Mode] : reporting to Quality Center
    // CurrentTestSet - [OTA COM Library].TestSet.
    // CurrentTSTest - [OTA COM Library].TSTest.
    // CurrentRun - [OTA COM Library].Run.
    // ----------------------------------------------------
    function Test_Main(Debug, CurrentTestSet, CurrentTSTest, CurrentRun) {
    var project = "D:\\Shivi\\Projects\\RIT\\92\\Testfor66501\\911RITTest\\911RITTest.ghp";
    var run = "addNumbers/addition/additionTest";
    var env = "RedHatTest";
    var executor = "C:\\Program Files\\IBM\\RationalIntegrationTester\\RunTests.exe";
    var raiseDefect = 1;
      try {
        TDOutput.Clear(); // clear output window
        var res = XTools.run(executor, "-project \"" + project + "\" -run \"" + run + "\" -environment \"" + env + "\" -noHTTP", -1);
        TDOutput.Print("result is " + res );
        if( res > 0 ) {
           if( CurrentRun != null ) {
              CurrentRun.Status = "Failed";
           }
           if( CurrentTSTest != null ) {
              CurrentTSTest.Status = "Failed";
           }
        }
      }
      catch(e)
      {
        TDOutput.Print("Run-time error [" + (e.number & 0xFFFF) + "] : " + e.description);
        // update execution status in "Test" mode
        if (!Debug) {
          CurrentRun.Status = "Failed";
          CurrentTSTest.Status = "Failed";
        }
      }
    }
  5. Click Finish.

    The selected HCL OneTest™ API resource can now be run from Quality Center by using the new VAPI-XP test.

Feedback