Sahi Pro - Applet APIs
Applet automation is supported since Sahi Pro V4.5Applets elements are identified by Sahi with
_a("appletIdentifier").
prefix._applet
Since Sahi Pro: 4.3Since Sahi OS: NA
_applet($identifier)
Arguments
$identifier | string | id of applet object |
Details
Returns a handle to the applet object. All child elements of the applet object are accessed from this handle.
Returns a handle to the applet object. All child elements of the applet object are accessed from this handle.
_click(_applet("SwingSet2Applet").jbutton("sun_small.gif"))
info_applet is the same as _a
Information on usage can be found here
_a
Since Sahi Pro: 4.5Since Sahi OS: NA
_a($identifier)
Arguments
$identifier | string | id of applet object |
Details
Returns a handle to the applet object. All child elements of the applet object are accessed from this handle.
Returns a handle to the applet object. All child elements of the applet object are accessed from this handle.
_click(_a("SwingSet2Applet").jbutton("sun_small.gif"))
info_applet is the same as _a
Information on usage can be found here
Applet Accessors
Below is a list of applet APIs and their identifiers
Applet Actions
Sahi Action APIs work on applets too. Just pass in applet accessors instead of DOM accessors- _click
_click(_a("SwingSet2Applet").jbutton("sun_small.gif"))
- _setSelected
// Selects option by text "Larry" _setSelected(_a("SwingSet2Applet").jcombobox(3), "Larry"); // Selects third option _setSelected(_a("SwingSet2Applet").jcombobox(3), "2"); // Selects third option _setSelected(_a("SwingSet2Applet").jcombobox(3), 2); // Selects option by regular expression _setSelected(_a("SwingSet2Applet").jcombobox(3),"/Lar/");
- _setValue
_setValue(_a("SampleApplet").jtextarea("smallTA"), "abcd"); _setValue(_a("SampleApplet").jslider(0),"90");
- _highlight
_highlight(_a("myapp").vbutton("vButton"));
Applet Fetch APIs
Following Sahi APIs work for fetching content from applets.- _getValue
_assertEqual("vButton Clicked", _getValue(_a("OracleApplet").jtextfield("Result"))); // or var $result = _getValue(_a("OracleApplet").jtextfield("Result")); _assertEqual("vButton Clicked", $result);
- _getText
_assertEqual("Click Me", _getText(_a("myapp").vbutton("vButton"))); // or var $text = _getText(_a("myapp").vbutton("vButton")); _assertEqual("Click Me", $text);
- _exists
_assert(_exists(_a("myapp").vbutton("vButton"))); // or var $exists = _exists(_a("myapp").vbutton("vButton")); _assertEqual($exists);