Each 4Test class has properties, which are characteristics of that class. The properties are listed with the description of each class in the help. The descriptions use the internal names, that is, the names that begin with the $ character. For example, $Location is a property of the HtmlLink class.
The internal names are provided in the class descriptions because they are the names that are used by the verification system. When you verify a property while recording a test case, the internal names are displayed in the Verify Window window.
But there are also 4Test names for each of these properties. These names use Hungarian notation, that is, they are prefixed with an abbreviation for the data type. The 4Test names are shown for the classes in the Library browser.
In addition to looking up the 4Test names of the properties in the Library browser, you can determine the 4Test name of an internal property as follows:
The 4Test name for the $Location property is sLocation, because $Location is a string, whose abbreviation is s.
Some other examples:
Internal Name | 4Test Name | Data Type |
---|---|---|
$TextColor | sTextColor | STRING |
$FontSize | iFontSize | INTEGER |
$FontStyle | FontStyle | FONTSTYLE |
$Contents | lsContents | LIST OF STRING |
You can retrieve the values of all properties directly in a script using dot notation as long as you use the 4Test name, not the internal name. Using the GMO Web application’s home page, for example:
INTEGER iSize iSize = GMO.WelcomeText.iFontSize Print (iSize) // Result: // 18
When using the internal name, use the GetProperty, GetTextProp, or GetItemProp method, whichever is appropriate. For example:
INTEGER iSize iSize = GMO.WelcomeText.GetProperty("$FontSize") Print (iSize) // Result: // 18