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.

Java APIs

Modes Java

Launch Java Application.

Parameters

NameTypeDescription
$applicationPathstringabsolute path of the Java application
$applicationLaunchCommandstringoptionalcommand to launch the Java application.
$applicationTypestringoptionalparameter specifying the type of java application.
Raw script
_launchJavaApplication("C:/Users/sample.jar");
_launchJavaApplication("C:/Users/sample.jar", "java -jar");
_launchJavaApplication("C:/Users/sampleOracleApp.jar", "java -jar", "ORACLE");
_launchJavaApplication("C:/Users/sampleJavaFxApp.jar", "java -jar", "JAVAFX");
_launchJavaApplication("C:/Users/sample.jnlp");
_launchJavaApplication("C:/Users/SampleJavaWS.jnlp", "javaws");

Sahi Pro Classic API _launchJavaApplication

Modes Java

Launch browser for Applet and open the specified URL. This action is required for Automating Applet Using Only Desktop Automation.

Parameters

NameTypeDescription
$URLstringURL to launch the Applet
$browserLaunchCommandstringcommand to launch the browser for Applet.
Raw script
_launchBrowserForApplet("https://www.test.example.com/login", "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe");
_launchBrowserForApplet("https://www.test.example.com/login", "C:/Program Files/Internet Explorer/iexplore.exe -private");

Sahi Pro Classic API _launchBrowserForApplet

Modes Java

Exits the Java Application process.
Use this action instead of _closeWindow if the java process is not exiting after closing the application manually or through Sahi Pro. This action helps to release resoures from machine.

Parameters

NameTypeDescription
None
Raw script
_exitJavaProcess();

Sahi Pro Classic API _exitJavaProcess

Modes Java

Simulates a drag action

Parameters

NameTypeDescription
$elementelementelement to be dragged
Raw script
// Drag the item
_dragNative(_jvJListItem(_jvJList("Countries"), "India"));

Sahi Pro Classic API _dragNative

Modes Java

Simulates a drop action

Parameters

NameTypeDescription
$elementelementelement where the dragged element will be dropped
Raw script
// drop the item
_dropNative(_jvJTextArea(0));

Sahi Pro Classic API _dropNative

Modes Java

Parameters

NameTypeDescription
$tableElelementTable element

Returns

array of integersarray with first value as row index and second value as column index of the table.
Raw script
var $cell = _getCellIndex(_jvCell(_jvJTable("SampleTable"), "43"));
_assertEqual(0, $cell[0]); // row number is 0 (i.e index 0 of $cell array).
_assertEqual(1, $cell[1]); // column number is 1 (i.e index 1 of $cell array).
_assertEqual("43", _getText(_jvCell(_jvJTable("SampleTable"), $cell[0], $cell[1]))); //Fetch value of table cell at [0,1].

Sahi Pro Classic API _getCellIndex

Modes Java

Parameters

NameTypeDescription
$elementelementElement whose icon's path we need

Returns

stringPath of the graphic image that the element displays.
Raw script
var $icon_path = _getIconPath(_jvJLabel("Success"));
_assertEqual("/success.png/", $icon_path);

Sahi Pro Classic API _getIconPath