Sahi - Sahi Pro Applet Support

Introduction

Sahi Pro v7.0.0 and higher versions provide support for automation of applets.

For recording or identification in Java Applet mode Sahi Pro Desktop Add-on should be installed.

warning Sahi Pro v7.0.0 has a newer mechanism of automating applets. The older implementation of applet automation
has now been removed.

Recording an Applet

From the Sahi Dashboard, open any browser and navigate to the page containing your applet.
Press ALT and double click on the document window of the page which you want to record. Sahi's Controller window will popup. You can now start recording. As with normal Sahi, you can use CTRL-Hover to identify various elements on the applet.

NOTE: For identifying JTable cells, you need to click on particular cell instead of CTRL-Hover.

Applet APIs

Applets APIs are different from normal JavaScript APIs. Most components are identified by its class name prefixed by "_jv".

Example:
_jvJButton("Test Button")
or
_jvJComboBox("ComboBox")

Applet also supports _near, _inside and _under APIs.

Example:
_jvJComboBox("ComboBox", _near(_jvJLabel("Mouth")));

_highlight(_jvJComboBox("ComboBox", _under(_jvJLabel("Mouth"))));

_setSelected(_jvJComboBox("ComboBox", _near(_jvJLabel("Mouth"))), "Larry");

_click(_jvJButton("sun_small.gif"));

For applet automation, you need to use _setMode("JAVA_APPLET") at the start of the script.

Trouble Shooting

Page hangs or Sahi does not recognize any element

While automating applets using Sahi make sure that java uses browser's proxy setting.
This can be configured in Java Control Panel as shown in below images.

Sample applet

A sample applet is available at http://sahi.co.in/demo/applet/simple.htm