Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.

Working with Menu items in a Popup Menu

Working with Menu items in a Popup Menu

When recording or identifying a menu with popup menu items which are not derived from a menu object class but created from a number of DomLinks, object not found errors may be experienced during playback.

The object not found errors will likely be caused by the menu item's we wish to interact with not being visible on screen.

The below example demonstrates how to resolve the above issue within a Workbench .Net script.

1) When you record a Workbench .Net script against the above menu type you may see a produced script similar to the below:-

.DomLink("//A[@textContents='Find']").Click(MouseButton.Left, New Point(30, 14))

2) The issue with the above script is that it will attempt to click on a menu item that is not yet visible on screen.

In order to select the hidden menu item, we need to set focus on the ‘Tools’ item and move the mouse to the location to display the submenu item for selection.

3) To identify the object via the identify object tool, click the Identify Object button on the Workbench tool bar.

4) Click the application you wish to identify a control from and click ‘Start Identify’ from the dialog window

5) With the identify Object window now open we can click the ‘Start Identify’ button

6) Click the item you wish to identify, a green highlight will denote the object to be selected.

 

 

7)  Click the 'test' button from the identify Object dialog to verify the correct item was selected, the item on the application should now be surrounded with a flashing a green selection box.

😎  Click the paste button on the Identify Object Window, the full locator will be pasted into the script, similar to below:-

//BrowserApplication//BrowserWindow//A[@textContents='Tools']

9)  As we know the object is of type DomLink, the locator can be modified to:-

.DomLink(“//A[@textContents='Tools']”)

10)  We then need to add a SetFocus() and moveMouse() function to the end of the locator to ensure that the submenu is displayed.

.DomLink(“//A[@textContents='Tools']”).SetFocus()

.DomLink(//A[@textContents='Tools']”).MoveMouse()

11)  Ensure the lines of script above are placed before the line

.DomLink("//A[@textContents='Find']").Click()

12) The script should now be able to played back..

If issues are still encountered after following these steps, please create a new support incident for a Silk test support engineer to investigate the issue.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2014-04-25 16:34
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.