|
GUI Map file is the place where QEngine stores the element
identification properties retrieved from the web page during recording.
ID will be generated for
each element and the ID will be provided as Object ID in the script
function. Appropriate element properties will be retrieved from the GUI
Map file using ID during playback and these element properties will be used by
QEngine to identify the particular element in the webpage.
GUI Map file acts as a repository for the Webpage elements.
How the GUI Map is Recorded and
Used
When you record user actions in a web page, QEngine captures user actions in the script using pre-defined keywords. QEngine also obtains the names and other properties of the HTML objects recorded and adds them into a repository called GUI Map. This file contains the window and element objects created during a test run to represent the actual objects in your web application. Each window or element object has a list of properties that uniquely identifies the object in your web application. During playback, QEngine reads an object’s description (window and element properties) in the GUI Map file and then looks for an HTML object with the same properties in the web application being tested.
QEngine has the ID attribute for each window and element node in the map file to uniquely identify each object in your web application. This attribute is generated based on the physical properties of the object. This attribute is non-editable. For example, for a text box object which has the physical properties such as name="loginName", formname="loginForm", type="text", disable="false", etc. QEngine generates the identification attribute for this text box object as ID="loginForm".
|
|
The properties listed below are the ones used for identifying the HTML element during record and playback. |
|
HTML Element |
Identification Properties for HTML Elements |
|---|---|
|
Window |
windowname, windowtitle, parenttitle, index |
|
Buttons (Push, Radio, Check, tagButton, tagReset, tagSubmit) |
id, name, value, index |
|
Image |
id, source, index |
|
HyperLink |
id, innertext, index |
|
Select |
id, name, index |
|
Text field, Text area, Password field |
id, name, index |
|
Map |
id, name, coords |
|
SPAN, LI, DIV, TD |
id, innertext, index |
Two Methods to Maintain GUI Map
There are two methods to maintain the GUI Map file: Map file per script (local to the script) and Map file per suite (global to the entire suite).
Map File per Script
Map File per Script is the default mode which creates the GUI map file for each script. First time users or evaluation users can use the local map file mode. When you have a small number of scripts per Suite, you can go with the local map file mode. This file is placed in <QEngine_Home>/projects/<Suite_Name>/webscripts/<Script_Name>/ directory with .map extension. The first line useLocalMapFile() in each script indicates that the script has a local map file.
Map File per Suite
When you have a large number of scripts per Suite and if you are editing the GUI map file for multiple scripts to suite specific needs, you can use the Global Map File mode. This mode will use a single map file for the entire suite of test scripts. To enable the Map File per Suite mode, choose the Settings tab. In the Play Settings page, from the Recorder Settings options, choose the check box Use Suite Level GUI Map. This mode creates a global map file for the entire Suite. The global map file is placed in <QEngine_Home>/projects/<Suite_Name>/conf directory. Note that in this case useLocalMapFile() command is not embedded in the script.
Once you feel the number of local map files (map files per script)
is increasing and maintenance is an issue, then you can choose to merge
them to a single map file.
To merge the local map file into a global map file, choose the Merge Map File option
from the script editor toolbar
option as shown in the image given below:

A confirmation dialog is displayed. Clicking Yes, merges the local map file(s) to global map file and displays a message box to remove the useLocalMapFile() statement from the script.
A global map file named global.map will be created under <QEngine Home>/projects/<Suite_Name>/conf folder.
In case you want to view/edit any of these properties, select a
script file from the Suites tree and right-click. A pop-up menu is
displayed. Choose Edit GUI Map
menu item from the popup or choose the View
Map File option
in the script editor toolbar.
The GUI Map File Configuration screen displays all the window and element object properties of a web page in a tree-view. In the left pane, you can view the parent node being the window node and the child nodes being the objects belonging to that window node. On clicking the child node, you can view the property name and values in the right pane. To edit the properties specific to an object,
From the tree view, select the required window or element node from the left pane. The properties of the selected object are displayed in a table in the right-pane.
Edit the property values for the selected node and click the Update button. After editing all the required properties, finally click the Save button to save the changed values in the appropriate application map file.
You can also choose specific condition such as equals, starts with or ends with from the Condition column to use regular expressions. For example, if your window title and parent title is dynamically changing and assume only the starting word of the title remains the same across pages then you can use the 'Condition' column to specify the window title and parenttitle as startswith and the starting word of the title in the 'Value' column.
|