Skip to content
Get Free Trial

Flex Functions

Sahi supports Flex applications via the Sahi Flex Library (SFL) Information on usage can be found here

Since
Sahi Pro 3.5

Modes Browser

_flex($identifier)

Arguments

NameTypeDescription
$identifierstringid of flex object

Returns

objectFlex object

Returns a handle to the flex object. All child elements of the flex object are accessed from this handle.

_setValue(_flex("mxComponents").textinput("txt1"), "English");

Information on usage can be found here

Since
Sahi Pro 3.6

Modes Browser

_f($identifier)

Arguments

NameTypeDescription
$identifierstringid of flex object

Returns

objectFlex object

Returns a handle to the flex object. All child elements of the flex object are accessed from this handle.

_setValue(_f("mxComponents").textinput("txt1"), "English");

Information on usage can be found here

Since
Sahi Pro 4.0

Modes Browser

_setFlexReadyCondition($fn)

Arguments

NameTypeDescription
$fnfunctionFunction which evaluates to true/false. Function denotes when the flex app is considered to be ready for Sahi.

Returns

null

This function should be used inside a browser tag. The $fn is called for each flex app on the browser, and the current flex app is passed as an argument to fn.

In some flex apps with lots of dynamically loading parts, it may be customary to show a rotating icon with “Loading…” or some such message. Sahi can be told to wait till this message disappears.

At the start of your script add this:

<browser>
_setFlexReadyCondition(function(fl){
return !_isVisible(fl.uitextfield("Loading..."));
});
</browser>