User Guide
14 Working with QuickTest Professional
The operation property is the event dispatched by the object that QTP records. This
property can take zero or more parameters. The number and type of parameters depend on
the type of control that is dispatching the event. They can be a key that was held down during
the operation, an index of a list entry, or the text entered in a text field. For example, when a
user enters characters in a FlexTextArea object, the text that the user entered is shown after the
operation. If the user entered the number 42 in a FlexTextArea object, the Expert View shows
a statement similar to the following example:
Browser("Main Page").FlexApplication("MyApp").FlexTextArea("ta1").Input
"42"
If the user selects text in a FlexTextArea object, QTP records a Select operation. This
operation takes two comma-separated parameters. The first parameter is the starting character
position, and the second parameter is the ending character position of the selection. If the user
selected the first four characters in a FlexTextArea object, the Expert View shows a statement
similar to the following example:
Browser("Main Page").FlexApplication("MyApp").FlexTextArea("ta1").Select
0,3
Identifying objects
Test objects are the building blocks of the test scripts in QTP. Each object used in the test is
stored in the object repository. Flex controls are mapped to these QTP test objects.
When you record a test, QTP adds each object that you interact with to the object repository
and references that object by its test object name in the script. The identifier that QTP uses is
the name property of the test object in the repository. This property is sometimes the same as
the Flex
id that the Flex developer specifies in the Flex application source code. For example,
a ComboBox control with a Flex
id of "myCombo" is stored in the object repository with the
name myCombo. In QTP scripts, you reference it as the following example shows:
FlexComboBox("myCombo")
However, Flex objects are not always identified in the script by their Flex id properties. In
many cases, the test object name matches what you see on the screen. The QTP test object
name of a FlexButton object, for example, is the value of the
label property of the object and
not the
id property. For example, the following FlexButton is identified in QTP object
repository as “Click Me”:
In the QTP expert view, you refer to that FlexButton object as the following example shows:
FlexButton("Click Me")