Command Builder for Windows

Top  Previous  Next

×V5.3Ø

S

A

W

WS

M

 

 

ü

Command Builder

The Command Builder is a tool that is built into EMUE that allows you to identify an element on a windows application. The tool will automatically build a valid command for that element.

 

Once an application has been opened using the OpenApp command, if the debugger is enabled, the Command Builder can be opened from the Tools menu.

 

Menu

 

 

Once you click the 'Find' button, you can identify elements in an application simply by hovering over the elements you wish to interact with and pressing the trigger combination. This can be configured by clicking the settings button to the right. If no activity is detected the 'Find' button will turn off after 30 seconds.

 

FindButton

 

Find Trigger Setting

 

To change the combination used to identify an element click the settings button and set your values. You can choose a single action or combine it with a modifier such as Alternate, Shift or Control. The default setting is trigger combination. The setting below sets it to 'F' key with no modifier.

 

FindTriggerSettings

 

Hovering Over Elements

 

Once the 'Find' button has been clicked, EMUE starts to recognize the elements you hover over in the application.  As you hover over an element, press the trigger combination on the desired control. EMUE will record that element in the white space below the buttons. Make sure the command builder is referencing the desired application in the 'Application Name' dropdown if you are working with multiple applications.

 

IdElement

 

Once an element is identified in the application, it will be highlighted by to inform the user which element has been selected.

 

Selecting an Element Type

 

After selecting the 'Find' button and identifying a specific element using the trigger combination, you might encounter a pop up menu with multiple element options. When this occurs select which element you would like to interact with. These will appear for elements such as edit/combo box, tree/tree item, and list/list item fields. The main purpose of this pop up menu is to lock on a specific element type, so you can interact with the application differently depending on your selected element.. For example, rather than retrieving an entire list from an application and bringing the list into EMUE, you might want to interact with a single list line item and right click instead.

 

PopUpMenu

 

 

Selecting Multiple Elements in Sequence

 

In the command builder, once you press the 'Find' button you may continue to identify as many elements on the screen as needed by placing your mouse over them and pressing the trigger combination. For example, below the user has selected a list, a list item, and a button. When you are finished, click 'Stop find' on the command builder. From here the user may make different decisions depending on what they would like pasted within their script.

 

MultiCommands

 

Building a Command

 

Once you have hovered over an element and it appears in the command builder window, there are dropdown menus to select specific commands and parameters based on the selected element.

 

BuildCommand

 

 

In the image above, the first dropdown menu determines which command you would like to use for a specific element and EMUE infers a command based on the element type selected. For example, if you select a list type field, then EMUE assumes you would like to read the contents of the list and places a GetList command. However, youre welcome to change the command, if the desired command is not the default.

 

 

BuildCommand2

 

Dropdown menus will appear to the right of the command occasionally, which signifies an additional parameter is needed to complete the command, such as a variable or a list. You can also type in a value that isnt a variable or an already established list within the script, which results in a hard-coded string in the command or a new list name. For example, above there is a GetList command for an list field, and the parameter to the right is the specific list name that will store the contents of the list in EMUE. These additional parameters change based on the command selected. For example, above, the user has also selected a ClickElement command for a button type and there is not a parameter to the right of the command like there is for the GetList command because a button doesnt need information typed into it or a list generated from it. A button can simply be clicked.

 

Anchoring and Using the Edit Element Window

 

When a command is selected from the list of commands, a pop-up dialog appears to find the appropriate anchor for the selected element, this is not always necessary. However, in situations where an element does not have a good identifier and the command will not interact as expected with an element, then EMUE will use the elements around the selected element to uniquely identify and interact with the selected element as expected. The biggest takeaway for anchoring is that it requires flexibility not every element will interact as expected and you might need to problem solve and try multiple scenarios to make the best decision for your script.

 

EditElementWindow

 

 

1. Parameters: The first section in the Edit Element Window includes the parameters for the selected element such as the Name, Type, and Index. The user may select which parameters they would like to include. The only required parameter is the TYPE parameter, but it is recommended that all parameters be used if theyre available.

 

2. Reference Type: In the Edit Element Window below the parameters there is the reference type selection where you can choose from Standard, Parent, and Position reference types.

 

       Standard: The standard reference is the simplest form and is the default when an element has a NAME attribute.

 

       Parent: If the selected element lacks a NAME parameter, the reference type defaults to the parent reference type and changes the element string to include a parent reference to identify the element more accurately. In the parent reference, EMUE looks for an element that is unique outside of the selected element such as, pane that contains a list. If there is no named parent available, this option is disabled.

 

       Position: The final reference is the position reference. In a position reference, the user can choose an element that is directionally around the selected element (left, right, above, or below). If the standard element and the parent element do not have a NAME parameter, then the user can select to use a position reference. If you decide to select the position reference, you will need to search the other elements around the current selected element using the “Find anchor” button.

 

3. Find Anchor Button: Once you have selected the position reference type, you will then select the “Find anchor” button to search the application page for an element that is to the left, right, above, or below the current selected element. Afterwards, the current element info section will change to reflect the new element string with a position reference.

 

4. Current Element Info: The 'Current Element Info' section displays the element string in its current state based on selections made by the user.

 

5. Reset and Close Button: The reset option will return the element to its original state before any anchoring occurred and the close button will close the Edit Element Window.

 

Up and Down Buttons

 

Depending on the interaction with the application, the user has the option to move each command line either up or down in the command builder to change the order of the commands.

 

UpDown

 

 

Selecting a Row in the Command Builder

 

When a row is selected in the command builder, that element (Search button) will be outlined in blue on the application as long as that control is still visible.

 

OutlineControl

 

When a reference is used in the element string, the reference is in orange and the target element is blue.

 

AnchorOutline

 

 

Deleting Commands

 

There is an option to delete commands from the command builder by clicking the "X" button to the right of each command.

 

DeleteCommand

 

 

Copy All Commands

 

After selecting the command, formatting the commands and placement, and selecting the reference type, you have many options for copying the information into your scripts. One of the options is to select the “Copy All” button and copy each element and paste into their existing script. Once the button is selected, the copied elements will appear on the left hand-side of the “Copy All” button. This means the elements have been copied to the clipboard and are able to be pasted to the script.

 

CopyAll

 

 

Copy One or More Rows

 

In addition to the “Copy All” button there is also the option to select one or more commands to copy and paste. Users can hold down the control key and select any number of rows to copy.  Once, one or more commands is  selected, the “Copy All” button will change to reflect “Copy (the number of elements selected)”.

 

 

CopyRows

 

Context Menu

 

When one row is selected the user is presented with a menu to copy just the element string, copy the selected command or copy all commands. When there are multiple or no rows selected the user is allowed to copy all commands and/or copy selected commands.

 

ContextMenuTwoRows