Add toolbar buttons
You can use the Toolbar Button Editor to define toolbar buttons to be displayed on the window of an ALM module, or on the Manual Runner dialog box.
-
In the Script Editor, click the Toolbar Button Editor tab.
-
From the Command bar list, select the toolbar to which you want to add a button:
Option
Toolbar Location
Requirements
Requirements module window.
TestPlan
Test Plan module window.
TestLab
Test Lab module window.
ManualRun
Manual Runner dialog box.
Defects
Defects module window.
Component
Business Components module window. This option depends on your ALM license.
Releases
Releases module window.
Resources
Test Resources module window.
Analysis
Analysis module window.
Dashboard
Dashboard module window.
BusinessModels
Business Models module window.
Libraries
Libraries module window.
TestRuns
Test Runs module window.
-
Click Add. A default command name for the button is added to the Commands list.
-
In the Caption box, type a new command name for the button, or use the default name.
-
In the Hint box, type a tooltip for the button.
-
In the Action Name box, type a new action name for the button, or use the default name.
-
Under Images, select an icon for the button.
-
Click Apply to apply your changes.
-
To delete a button that you have created, select its command name in the Commands list, and click Remove.
-
Click the Save button to save the new button definition.
-
Click the Script Editor tab.
-
In the Scripts Tree of the Script Editor, select the ActionCanExecute event procedure located in the common script section.
-
In the procedure displayed in the scripts pane of the Script Editor, add statements to be performed if the user initiates an action with the action name you defined for the button. Set the return value to
True
orFalse
.For example, the following code opens a message box when the user clicks the Requirements_Action1 button on the tool bar of the Requirements module:
Copy codeFunction ActionCanExecute(ActionName)
On Error Resume Next
ActionCanExecute = True
If ActionName = "UserDefinedActions.Requirements_Action1" Then
MsgBox "You clicked the Action1 button."
End If
On Error GoTo 0
End FunctionFor details, see Example: Adding Button Functionality.
-
Click the Save button to save the script.
See also: