Sahi Pro - Sahi Applet Support (Beta)
Introduction
Sahi Pro V4.5 and higher versions provide support for automation of applets.
For automating your applets you need to configure Sahi for applet support.
- Open
/config/sahi.properties
- Set the below statement to true and save this file
applet_support.enabled=true
- Restart Sahi.
Automating Oracle Forms
For automating Oracle Forms following steps need to be done
- Open "Configure Sahi" page by clicking on "configure" link on Sahi's Dashboard.
- Click on “download_contenttypes.txt”.
- Remove the following line from download_contenttypes.txt.
- Click Save.
- Restart Sahi.
application/octet-stream
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 (outside applet area). 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: Sahi currently automates only Java Swing based applets
Applet APIs
Applets APIs are different from the normal JavaScript APIs. All elements are prefixed with
_a("appletId").
or _applet("appletId").
followed by the component type and component id.
Example:_a("SampleApplet").jbutton("Test Button")
or_applet("SampleApplet").jbutton("Test Button")
_a and _applet API's can be used interchangebly.Applet also supports near
, inside
and under
APIs.
_a("SampleApplet").jcombobox("").near(_a("SampleApplet").jlabel("Mouth"));
_highlight(_a("SampleApplet").jcombobox("").under(_a("SampleApplet").jlabel("Mouth")));
_setSelected(_a("SwingSet2Applet").jcombobox(3).near(_a("SampleApplet").jlabel("Mouth")),"Larry");
_click(_a("SwingSet2Applet").jbutton("sun_small.gif"));
Some more detail on Applet APIs
Trouble Shooting
Java security error while loading applets with Sahi
Following security error may occur while automating applets with Sahi.Solution
- Open Java Control Panel. Where is Java Control Panel in Windows
- Select "Enable - hide warning and run with protections" Security verification option as shown in below image.
Where is Java Control Panel in Mac
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.
Applet: Delete Java Cache
-
Click on the
Start
button and then click on theControl Panel
option.
-
In the
Search Control Panel
enterJava
.
-
Click on the
Java
icon to open theJava Control Panel
.
-
In the
Java Control Panel
, under theGeneral
tab, clickSettings
under theTemporary Internet Files
section.
-
The
Temporary Files Settings
dialog box appears.
-
Delete
Temporary Java Files
throughJava Control Panel
-
Make
Temporary Files
not to store on your computer.
- Uncheck
Keep temporary files on my computer.
checkbox and click onOK