Working with objects on screen


It is desirable to follow the following recommendations for successful automation of GUI programs:

1. Be careful when choosing the responsive to mouse objects

Some control elements can react to mouse-over by pop-up of prompts, changing its form, name, size or other properties. This can interfere with the normal performance of the recorded task, as MouseRobot will remember and seek not the original item but its altered form, which appears only when the mouse points to it.

Example:

One second after the mouse cursor is over the list item of Services hint appears, but it is not displayed near the mouse cursor, but directly beneath it.


As a result, if you press Ctrl to remember the properties of an element after the appearance of the hint, MouseRobot remembers it. In the process of task execution the hint  will not on the screen and MouseRobot will not able to execute the step.

2. Use "hot keys"

If it is possible to call the necessary command, function, dialogue or operation in the automated program by pressing key combinations, it is recommended to use them.

3. Move between the data entry fields, using the keyboard

To move between the dialogue fields, table cells, etc. it is desired to use the Tab key and Shift + Tab, to confirm or cancel data entry by pressing {ENTER} and {ESC} (or other, depending on the automated program). In this case, in the capture of the object for the step "Search object on screen", it is recommended to specify heading of dialogue rather than its elements as a subject. This will allow obtaining compact and easily modifiable task records in Mouse Robot, and moreover, increasing the reliability of execution.

4. Use quick transition to elements of the window with Alt + letter

Many programs allow the transfer to the necessary control element (flags, buttons, menu items, ...) by pressing the keyboard shortcut Alt + letter (when pressing Alt the corresponding letters in the names of the elements are displayed as underlined).

5. Automate the search of fields, not headings

If the window of the automated program contains a large number of similar fields (e.g., web-form) it is desirable to specify to Mouse Robot to search not for the fields, but for their headings, which in most cases are unique and can be found with a high degree of reliability. If necessary, the input focus can be switched from the header to the field by pressing the {TAB}, however, most programs will automatically activate the field when you click on its title.

6. Choose easily recognizable objects

When there are a large number of similar objects, you can improve the reliability of the search facility by entering an object of a higher level. You can navigate through the levels by pressing the PgUp and PgDn in the capture of the object (for example, to specify the entire table instead of a specific cell).

Example:

The toolbar of the graphics editor Paint.NET 3 contains the drawing tools but does not provide the names of the keys or their ordinal numbers. As a result, all the buttons look identical to MouseRobot, which can result in incorrect task execution. However, the buttons of the toolbar will never change their position, so when selecting an object it is sufficient to press PgUp to rise from the button  to the level of the toolbar, and remember the position of the press already relating to it.

7. Use browsers that support advanced automation

It is recommended to use Microsoft Internet Explorer and Mozilla Firefox browser when automating the web-interface, as they provide access to page elements for external programs, such as MouseRobot. Similar devices for Google Chrome, Apple Safari and Opera are in development and should be available in the latest versions of these browsers.

8. Extend timeout for step "Search object" following after the program launch

In reality, the time required to load the program and the contents of its windows may differ from the average by several times.

If the execution of the previous step may take some time (running an application, loading a web page), then set "Step Timeout" parameter for the following steps (the "Common" panel) for 10 seconds or more.

9. Check for running copy of the launched program instead of restarting it

Often it is preferable to use the already running program instead of starting a new copy. You can use the snippet "Check and run if needed".

10. Use looping facilities

MouseRobot provides an excellent opportunity to automate the repetitive operations of the same elements. You can use snippets from "Loop through objects"

11. Monitor the performance of long processes

If the automated program displays a dialog with progress of execution (for example convert video, compilation, etc.), while an action is being performed, it is recommended to add the snippet "Waiting for window close" to the task.