Understanding GUI Map File


What is GUI Map File


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.

 

GUI Map File Merge Option

 

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.

 

Viewing/Editing GUI Map

 

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,



Copyright © 1999, AdventNet Inc. All Rights Reserved.