![]() | Flex-specific |
---|---|
The Flex Object API is only available for the Squish for Web editions. |
Squish provides a comprehensive API for Flex objects, which is documented here in its entirety.
Here are some quick links to the Flex Object API's functions:
This function can be used to set the date in the objectOrName
datefield widget.
The dateString
has to be a string of the form "2013/04/27", with the first four
digits denoting the year, the next two digits denoting the month and the last two digits denoting the day.
For months and days smaller than 10 add a leading zero to the number. The 3 values need to be separated as
indicated above using forward slashes.
This function clicks the objectOrName
widget
which should be the name of a button or a reference to a button object.
This function clicks the objectOrName
widget's
item that has the specified itemText
. This will
work for any Combobox widget.
If the objectOrName
is a tree or tree item, it is
collapsed so that none of its child items (if it has any) are visible. (See also
expand
.)
doubleClick(
objectOrName, mouseButton)
;
doubleClick(
objectOrName, mouseButton, modifierState)
;
doubleClick(
objectOrName, x, y, mouseButton)
;
doubleClick(
objectOrName, x, y, mouseButton, modifierState)
;
This function double-clicks the objectOrName
widget.
By default the widget is double-clicked in the middle, but this can be
changed by passing widget-relative coordinates, x
and y
. By default
MouseButton.LeftButton
is used, but this can be changed by
specifying the optional mouseButton
argument.
Similarly a default modifier state of Modifier.None
is
used, but this can be changed by specifying the
modifierState
argument. Note that to specify the
button, the coordinates must also be specified; and to specify the modifier
state, the coordinates and the button must also be specified. See Flex Object API Function Parameters for which values are valid
for the mouseButton
argument and for the
modifierState
argument.
If the objectOrName
is a tree or tree item, it is
expanded to show its child items (if it has any). (See also
collapse
.)
This function installs a global event handler. The script function
named or referenced in handlerFunctionNameOrReference
,
will be called when an event
of the eventName
type occurs.
The eventName
can be the name of any of the
following event types:
"DialogOpened" – this occurs when a dialog is opened
The function named in handlerFunctionName
is
called with a single argument—the object on which the event
occurred.
For examples see How to Use Event Handlers (Section 5.10).
![]() | The AUT Must be Running |
---|---|
The |
mouseClick(
objectOrName, mouseButton)
;
mouseClick(
objectOrName, mouseButton, modifierState)
;
mouseClick(
objectOrName, x, y, mouseButton)
;
mouseClick(
objectOrName, x, y, mouseButton, modifierState)
;
This function clicks the mouse on the specified
objectOrName
widget.
If only the objectOrName
is specified, then the
object is clicked in the middle by the
MouseButton.LeftButton
. All the other usages
require the mouseButton
to
be specified, optionally preceded by by object-relative coordinates,
x
and y
which say where
the click takes place, and optionally followed by a
modifierState
(which defaults to
Modifier.None
if not specified).
See Flex Object API Function Parameters for which values
are valid for the mouseButton
argument and for
the modifierState
argument.
mousePress(
mouseButton)
;
mousePress(
mouseButton, modifierState)
;
mousePress(
x, y, mouseButton)
;
mousePress(
x, y, mouseButton, modifierState)
;
mousePress(
objectOrName)
;
mousePress(
objectOrName, mouseButton)
;
mousePress(
objectOrName, mouseButton, modifierState)
;
mousePress(
objectOrName, x, y, mouseButton)
;
mousePress(
objectOrName, x, y, mouseButton, modifierState)
;
This function performs a mouse press. All the parameters are optional excepting that either both or neither of the coordinates must be present.
If x
and y
coordinates are
given, the press takes place at those coordinates, either relative to the
objectOrName
object if one is specified, or
relative to the current screen otherwise. If no coordinates are given
the press takes place on the middle of the
objectOrName
object if one is specified, or
wherever the mouse happens to be otherwise.
By default MouseButton.LeftButton
is used, but this can be
changed by specifying the optional mouseButton
argument. Similarly a default modifier state of no modifiers is used,
but this can be changed by specifying the
modifierState
argument. See Flex Object API Function Parameters for which values are valid
for the mouseButton
argument and for the
modifierState
argument.
mouseRelease(
mouseButton)
;
mouseRelease(
mouseButton, modifierState)
;
mouseRelease(
x, y, mouseButton)
;
mouseRelease(
x, y, mouseButton, modifierState)
;
mouseRelease(
objectOrName)
;
mouseRelease(
objectOrName, mouseButton)
;
mouseRelease(
objectOrName, mouseButton, modifierState)
;
mouseRelease(
objectOrName, x, y, mouseButton)
;
mouseRelease(
objectOrName, x, y, mouseButton, modifierState)
;
This function performs a mouse release. All the parameters are optional excepting that either both or neither of the coordinates must be present.
If x
and y
coordinates are
given, the release takes place at those coordinates, either relative to the
objectOrName
object if one is specified, or
relative to the current screen otherwise. If no coordinates are given
the release takes place on the middle of the
objectOrName
object if one is specified, or
wherever the mouse happens to be otherwise.
By default MouseButton.LeftButton
is used, but this can be
changed by specifying the optional mouseButton
argument. Similarly a default modifier state of no modifiers is used,
but this can be changed by specifying the
modifierState
argument. See Flex Object API Function Parameters for which values are valid
for the mouseButton
argument and for the
modifierState
argument.
Squish automatically adds a property called nativeObject
to every Flex Object's list of properties. The native object provides
access to all the underlying object's methods and properties.
For examples of how to use the nativeObject
see How to Use the nativeObject Property (Section 5.7.2).
This function sets the scroll position of the, objectOrName
scrollbar widget to the given integer
value.
This function can be used to scroll a scrollbar. The given value is in logical units and not pixels.
This function sets the value of the, objectOrName
spinbox widget to the given integer
value.
This function can be used to set the numeric value in a spinbox.
This function types the specified text
(as if the
user had used the keyboard) into the objectOrName
editable widget. If the text is surrounded by angle brackets (<>),
it is interpreted as a key combination, e.g
"<Ctrl+Return>"
. The input is case-sensitive, so
type(object, "R")
is different from
type(object, "r")
. (For a list of the
supported special keys see the nativeType
function's documentation.)
This function uninstalls an event handler that has been previously
installed using installEventHandler
.