User Guide

About the testing script 13
When you play back the test, QTP opens the browser and requests the same URL.
Be sure to specify an HTML file or other wrapper file type that embeds the applications SWF
file. You should not request the SWF file directly.
About the testing script
QTP records the test in an object level view called the Keyword View, and a text-only view of
steps called the Expert View. You can edit each view, and QTP updates the other one. For
example, if you remove a step in the Expert View, QTP removes the step from the Keyword
View. The same is true for adding steps or adding and removing checkpoints.
The Expert View represents each step in the test as an action in VBScript. VBScript uses dot-
notation to separate parent from child objects. Each line ends with an action, followed by
parameters that define that action.
The following example shows a mouse click in the Expert View:
Browser("Main Page").FlexApplication("MyApp").FlexButton("b2").Click
The follows example shows the Expert View syntax for Flex applications:
Browser("document_title").FlexApplication("app_name").test_object("name").
operation [parameters]
The document_title property is defined by the <TITLE> tag in the <HEAD> block of an
HTML page. For a Flex application, the default value of the
<TITLE> tag in an HTML
wrapper is the URL to the MXML file. If page does not have a title, QTP uses
Browser.
The
app_name property is the same as the ID property of the SWF file embedded in the
HTML pages
<object> tag.
The
test_object is the QTP test object that the Flex control corresponds to. For example, a
Button control’s QTP test object is FlexButton. This object takes a
name property, which is
the QTP name for the object as it appears in the object repository. This name is usually based
on its appearance (such as a label), and is sometimes the same as the Flex
id in the Flex
MXML source code.