Skip to content
Sahi Pro Flowcharts is retired. These pages document the last release (v12) and are no longer updated. Go to the current documentation.Flowcharts is retired. Current docs
Get Free Trial
Sahi Pro Flowcharts is retired. These pages document the last release (v12) and are no longer updated. Go to the current documentation.

Applet Automation

This section details how to test Java Applets. If you are not familiar with Sahi Pro Flowcharts, see Introduction to Sahi Pro Flowcharts.

Java Applets can be automated using the following approaches.

  1. Applet Automation Using Only Desktop Automation

    • This is available since Sahi Pro v10.0.0.
    • This approach needs ONLY Sahi Pro Desktop Engine license.
    • Applet elements are automated using JAVA mode, while elements on browser are automated using WINDOWS mode.
  2. Applet Automation Using Browser and Desktop Automation

    • This is available since Sahi Pro v7.0.0.
    • This approach needs both Sahi Pro and Sahi Pro Desktop Engine licenses.
    • Applet elements are automated using JAVA_APPLET mode, while elements on browser are automated using BROWSER mode.

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, _in 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"));

Page hangs or Sahi does not recognize any element

Section titled “Page hangs or Sahi does not recognize any element”
  1. 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.

  2. Clear Java cache by deleting Temporary Files through the Java Control Panel. Click on the “Settings” button.

    Uncheck the checkbox adjacent to “Keep temporary files on my computer” and click “Delete Files..” then click “Ok” button.

  3. Click on the “Configure” link on the Sahi Dashboard and click “download_contenttypes.txt”.

    Comment “application/octet-stream”, save and restart Sahi.

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