Example: Customizing the workflow in HP ALM Quality Center
You can add workflow scripts to HP Quality Center to customize the user interface and add actions for users.
About this task
In this workflow customization example, a toolbar button is added to the Test Lab module that allows users to set an Rational® Integration Tester environment for all tests in the current Test Set.
Note: The script included in the following
example is supported only with HP ALM Quality Center 11.5, 12.2, or
12.5.
Procedure
- Start Quality Center and log in to your project.
- Select Customize from the Tools menu.
- Click Workflow on the left side of the screen.
- On the Workflow page, click the Script Editor link.
- Click the Toolbar Button Editor tab on the Script Editor page.
- Click Test Lab in the Command bar list.
- Click Add to add a command.
-
Change the following items:
- Caption: GHTester Environment
- Hint: Select the GHTester Environment for all Tests in the Test Set
- Action Name: TestLab_GHTesterEnv
- Using the list of available images, choose an icon to display on the toolbar button.
- Click Apply.
- Click the Script Editor tab.
- Expand the tree on the left to show and select it.
-
Change the script (on the right) to the following.
Function ActionCanExecute(ActionName) On Error Resume Next If ActionName = "UserDefinedActions.TestLab_GHTesterEnv" Then If IsObject(TDConnection) Then Set TSTestFactory = Actions.TSTestFactory Set TSTest = TSTestFactory.Item(TestSetTest_Fields("TC_TESTCYCL_ID").value) Set dlg = CreateObject("GHTester_ExecConfig.EnvSelectionHelper") If IsObject(TSTest) Then dlg.EnvironmentDialog TDConnection, TSTest Else MsgBox "No test was selected. Please select a Test instance in a Test Set's Execution Grid and try again.", 48, "No Test Selected" End If End If End If On Error GoTo 0 End Function
Note: If your script already had other action buttons that are defined, you must insert only the following code into the existing script:If ActionName = "UserDefinedActions.TestLab_GHTesterEnv" Then If IsObject(TDConnection) Then Set TSTestFactory = Actions.TSTestFactory Set TSTest = TSTestFactory.Item(TestSetTest_Fields("TC_TESTCYCL_ID").value) Set dlg = CreateObject("GHTester_ExecConfig.EnvSelectionHelper") If IsObject(TSTest) Then dlg.EnvironmentDialog TDConnection, TSTest Else MsgBox "No test was selected. Please select a Test instance in a Test Set's Execution Grid and try again.", 48, "No Test Selected" End If End If End If
- On the File menu in the Script Editor, click Save.
- Close the Script Editor.
- Click the RETURN button to go back to Quality Center.
-
When prompted in the Customization
Changes dialog, specify whether the change is major
or minor (this specification affects how the change is passed to users)
and click OK.
After users connect to the project in a new session, the toolbar button is displayed on the Test Lab toolbar.