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. 8) 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.
↧