GetRegionList Function

Class

HtmlImage.

Action

Returns the list of regions for the image map.

Availability

This functionality is supported only if you are using the Classic Agent.

Syntax

lsRegionList = image.GetRegionList ([bFullLocation])
Variable Description
lsRegionList The list of regions. LIST OF STRING.
bFullLocation Optional: TRUE to return the region names as full URLs, starting with $. Default returns the base path. BOOLEAN.

Notes

An image map is an image that contains regions, which are areas that are links that can be clicked on. The GetRegionList function returns a list of the URLs in the specified image map. By default, each URL is identified as the base path of the URL, that is, the path to the URL from the current page (file extensions are stripped out). You can have GetRegionList return the full URL by specifying TRUE as the argument. GetRegionList prefaces full URLs with the $ character.

If the link does not use the http protocol (for example, if it is an ftp or mailto link), GetRegionList always returns the full URL.

Silk Test Classic can detect regions in image maps that are rendered on the client, but not image maps that reside on the server. To determine whether a clickable image is a client-side or a server-side image, move the mouse over the clickable spots in the image, if the status bar updates to show the jump locations, then the image is a client-side image map. If the status bar does not update with jump locations, it is a server-side image map.

With the DOM extension, each region is identified as an HtmlLink.

Example 1

This example uses an image that consists of six clickable regions, each of which appears to be a button. The image is declared as ButtonBar.

ListPrint (ProtoPage.ButtonBar.GetRegionList())

// Result:
// icons#dist
// icons#central
// icons#auto
// icons#scripts
// icons#multi
// icons#true

Example 2

This is the same as the preceding example, except that the optional argument is used and [...] is replaced by the complete location of the files

ListPrint (ProtoPage.ButtonBar.GetRegionList(TRUE))

// Result:
// $http://[...]/icons.htm#dist
// $http://[...]/icons.htm#central
// $http://[...]/icons.htm#auto
// $http://[...]/icons.htm#scripts
// $http://[...]/icons.htm#multi
// $http://[...]/icons.htm#true