Java APIs

_launchJavaWSApplication

Since: Sahi ProSahi OSSahi Pro StarterDesktop Add-OnMobile Add-On
NANANA7.0.0NA

Available for modes: Java

_launchJavaWSApplication($applicationPath)

Arguments
$applicationPathstring absolute path of JNLP specific application

Returns
null

Details

Launch Java Web Start Application.

_launchJavaWSApplication("C:\\Users\\sample.jnlp");
danger DEPRECATED: _launchJavaWSApplication is deprecated since Sahi Pro Desktop Add-On 7.5.0. Use _launchJavaApplication instead.


_launchJavaApplication

Since: Sahi ProSahi OSSahi Pro StarterDesktop Add-OnMobile Add-On
NANANA7.5.0NA

Available for modes: Java

_launchJavaApplication($applicationPath, $applicationLaunchCommand)

Arguments
$applicationPathstring absolute path of the Java application
$applicationLaunchCommandstring command to launch the Java application.

Returns
null

Details

Launch Java Application.

_launchJavaApplication("C:\\Users\\sample.jar");
_launchJavaApplication("C:\\Users\\sample.jar", "java -jar");

_launchJavaApplication("C:\\Users\\sample.jnlp");
_launchJavaApplication("C:\\Users\\sample.jnlp", "javaws");


_dragNative

Since: Sahi ProSahi OSSahi Pro StarterDesktop Add-OnMobile Add-On
NANANA7.5.0NA

Available for modes: Java

_dragNative($element)

Arguments
$elementelement element to be dragged

Returns
null

Details

Simulates a drag action

// Drag the item
_dragNative(_jvJListItem(_jvJList("Countries"), "India"));


_dropNative

Since: Sahi ProSahi OSSahi Pro StarterDesktop Add-OnMobile Add-On
NANANA7.5.0NA

Available for modes: Java

_dropNative($element)

Arguments
$elementelement element where the dragged element will be dropped

Returns
null

Details

Simulates a drop action

// drop the item
_dropNative(_jvJTextArea(0));


// drag and drop action on same window
_selectWindow("Country List");
_dragNative(_jvJListItem(_jvJList("Countries"), "India"));
_dropNative(_jvJTextArea(0));

// drag and drop action on different window
_selectWindow("Country List");
_dragNative(_jvJListItem(_jvJList("Countries"), "India"));
_selectWindow("Application Form");
_dropNative(_jvJTextArea(0));


_getCellIndex

Since: Sahi ProSahi OSSahi Pro StarterDesktop Add-OnMobile Add-On
NANANA8.0.0NA

Available for modes: Java

_getCellIndex($tableEl)

Arguments
$tableElelement Table element

Returns
array of integersarray with first value as row index and second value as column index of the table.

Details

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].


_getIconPath

Since: Sahi ProSahi OSSahi Pro StarterDesktop Add-OnMobile Add-On
NANANA8.0.0NA

Available for modes: Java

_getIconPath($element)

Arguments
$elementelement Element whose icon's path we need

Returns
stringPath of the graphic image that the element displays.

Details

var $icon_path = _getIconPath(_jvJLabel("Success"));
_assertEqual("/success.png/", $icon_path);