TestOptimal Wiki

Model-Based Testing (MBT)

User Tools

Site Tools


UI Map Tab

UI Map allows you to build a layer of indirection between your automation script (MScript or java code) and the UI control on AUT. By defining this mapping, you can reference UI controls by the assigned uiid in MScript and TestOptimal will resolve to the actual control locator you have defined in this mapping list. This layer of indirection allows you adapt to changes to UI controls easily without changing the automation script (MScript).

UI Map also shows images of UI controls that can be used with Sikuli plugin to identify and interact with the UI.


UI Map can be stored in a csv file, Excel spreadsheet, url or sql database. You simply define the UI Map URI in Model Property using one of the formats defined in Read From File, Excel, Java, URL.

Besides specifying UIMap in external text file, you can also import UI Pages from UI Repository (UIRepo).

UIMap File Format

UI Map file must contain the following columns (note backslashe character “\” can not be used in the column names and single quote should not be escaped):

Application Window UIID Locator Description

You may use different names for these columns or order these columns in different order in the file. But if you do, you must position these columns to match the order specified in the expected order.

For example if you name these columns as uiid, app, win, loc, desc in the Excel sheet, then you will use the following URI definition:


Importing UIPage from UIRepo

If you have built UI Pages in UIRepo, you may import UI Pages into UIMap for the current model. To do so, click on UI Page link on the upper-right corner of the tab and select UI Page you wish to import.

All UI Elements for the selected UI Page are automatically imported into UIMap. If you wish to remove some UI Elements, you may do so by clicking on “x” next to the UI Element.

Only UI Pages/Elements imported from UIRepo may be removed. UI Elements from UIMap file can only be removed by editing UIMap file.

You may access UIRepo by clicking on the link UIRepo on the header line.

If you have changed UI Pages that you have imported to the model, you may apply the updates to the current model by re-importing those UI Pages. However if you have removed some UI Elements before, you will need to remove them again after the re-import.

Access UI Map

In MScript editor, you can bring up the list of UI Map items with Ctrl-U. You will then use this uiid to replace the normal locator for the element. If uiid is not unique, you can use application and window qualifier with the syntax of app/win/uiid. For example map=app1/loginWin/userID.

You may only use uiid if it is unique in the UI Map list. For example if userID is unique, you can use map=userID or map=loginWin/userID instead of the full path as shown in the example above.

UI Images

UI Images are used by Sikuli plugin to identify UI controls. They are stored in /uimap/ subfolder within the model folder.

To create a new image:

  • open AUT and navigate to the window that shows the UI control which you would like to take an image
  • mouse over Take Image button which should pop up a small window
  • enter an image name (without file extension)
  • if you have more than one monitors attached to your computer, specify the monitor id
  • click on Take Image button
  • use mouse to highlight the UI control (hold down left mouse button, drag and release left mouse button)
  • the image file is created and added to the image list

You can delete the image file by mouse over the image file name and click on x.

ui_map.txt · Last modified: 2018/08/22 00:03 by admin