GetProperty Function (AnyWin)




Returns the value for a given property of the test object.


aValue = object.GetProperty (sName)
Variable Description
aValue The value of the sName property. ANYTYPE.
sName The case-sensitive name of the property. To access a CSS style, set sName to currentStyle:<style name>. For example, to access the CSS style 'font-size', set sName to currentStyle:font-size.STRING.


An image link consists of an image and an associated anchor link. The target URL is the HREF attribute of the anchor link, not of the image itself. To get the URL, call GetLocation() for either the image or the anchor link, or call GetProperty("$Location") for the anchor link. To get the image file name, call GetFileName() or GetProperty("$Href") for the image.

Both the image and the anchor link have the same rectangle, so when you do Verify Properties and point at the image, you usually will verify the image rather than the anchor link.

If an object is defined by multiple HTML tags, then GetProperty() returns style properties based on the value of only the outermost tag's style elements. For example:

If your Html page contains Silk Test Classic returns
<i><p>text<p><i> $FontStyle=FS_ITALIC
but: <p><i>text<i><p> $FontStyle=normal
<span style="font-style: italic"><p>text</p></span> $FontStyle=FS_ITALIC
but: <p><span style="font-style: italic">text</span></p> $FontStyle: normal

Silk Test Classic does not consider the <i> or <span> tags when they lie inside the <p> tag, only when they lie outside the paragraph tag.

GetProperty() and GetPropertyList() on ActiveX controls in a browser return the properties of the parent BrowserChild, rather than the ActiveX controls themselves.


// return the caption of the Open dialog
aProp = Open.GetProperty ("Caption")