xamContextMenu Test Object Recordable Methods Summary
Recordable methods summary chart
The following table briefly explains the recordable methods for testing the control. Detailed information about the methods is provided in the text blocks following the table.
The CheckMenuItem records and replays the marking of the check box of a specified menu item.
Details
When the marking of the checkbox of a menu item action is recorded, the location of the menu item is stored as a unique path. This path consists of the headers of the parent menus’ items and the header of the targeted menu item.
In case there are duplicate or missing headers, the menu item index is recorded.
When a testing script is being created manually, you the following options are available for specifying the path to the menu item:
headers
indexes
a combination of headers and indexes
When replaying the marking action, if the checkbox is already marked, the action is ignored and the checkbox remains marked.
Parameters
The following table explains the method’s parameters along with some sample code.
Method parameter
Description
Header identifier
The unique menu item header identifier is:
for root menu items: the header
for sub-menu items: the path to the item consisting of the headers of the parent items pointing to the item, stored in an array
Note: The menu items are listed in hierarchically downward order, i.e. root item, sub-item, sub-sub-item (see the example).
Example
Marking the checkbox of an item named “ Pdf ” which has a parent item File belonging to the root menu item Create (Create>File>Pdf):
The following table lists the possible exceptions for the method and the reason that is likely to be causing them.
Exceptionname
Exception description
Possible reasons
Cannot perform the specified action as the item is not checkable.
The specified menu item cannot be checked.
The menu item property IsCheckable is not set to True.
The following item was not found.
The xamContextMenu item with the specified header text cannot be found.
The method parameter is not correct.
The specified index is out of range.
The xamContextMenu item with the specified index cannot be found.
The method parameter is not within the valid range of item indexes.
SelectMenuItem Method
Description
The SelectMenuItem method records and replays a mouse click on a specifed xamContextMenu item.
Details
When a click on a menu item is recorded, the location of the menu item is stored as a unique path. This path consists of the header of the parent menu items and the header of the targeted menu item.
In case there are duplicate or missing headers, the index of the item is recorded.
When a testing script is created manually, you can use the following options to specify the path to the menu item:
headers
indexes
combination of headers and indexes
Parameters
The following table explains the method’s parameters along with some sample code.
Method parameter
Description
Header identifier
The unique menu item header identifier is:
for root menu items: the header
for sub-menu items : the path to the item consisting of the headers of the parent items pointing to the item, stored in an array
Note: The menu items are listed in hierarchically downward order, i.e. root item, sub-item, sub-sub-item (see the example).
Example
Clicking on a child xamContextMenu item File with a parent named Create :
The following table lists the possible exceptions for the method and the reason that is likely to be causing them.
Exception name
Exception description
Possible reasons
The following item was not found.
The xamContextMenu item with the specified header text cannot be found.
The method parameter is not correct.
The specified index is out of range.
The xamContextMenu item with the specified index cannot be found.
The method parameter is not within the valid range of item indexes.
UnCheckMenuItem Method
Description
The UnCheckMenuItem method is used for recording and replaying unchecking the check box of a specified menu item.
Details
When the unchecking of a menu item checkbox action is recorded, the location of the menu item is stored as a unique path. This path consists of the header of the parent menu items and the header of the targeted menu item.
In case there are duplicate or missing headers, a menu item index is recorded.
When a testing script is created manually, you can use the following options to specify the path to the menu item:
headers
indexes
combination of headers and indexes
When replaying the unchecking, if the item is already unchecked, the action is ignored and the item remains unchecked.
Parameters
The following table explains the method’s parameters along with some sample code.
Method Parameter
Description
Header identifier
The unique identifier of the menu item header is:
for root menu items: the header
for sub-menu items : the path to the item consisting of the headers of the parent items pointing to the item, stored in an array
Note: The menu items are listed in hierarchically downward order, i.e. root item, sub-item, sub-sub-item (see the example).
Example
Unchecking the checkbox of a child menu item Pdf with root menu item – Create and a parent – File ( Create>File>Pdf ):
This topic provides reference information about the proxy class that supports the testing of the xamContextMenu™ control in Micro Focus Unified Functional Testing software.
This page has encountered an error. We've attempted to send the information to the server.