Windows APIs

Windows automation is supported since Sahi Pro Desktop Add-on

Windows Actions

Sahi Action APIs work on windows since Sahi Pro Desktop Add-on. Just pass in windows accessors instead of DOM accessors

_setSelectedExcelTab

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

Available for modes: Windows

_setSelectedExcelTab($element)

Arguments
$elementstring Excel Sheet.

Returns
null

Details

Select the specified sheet in Excel
_setSelectedExcelTab(<<sheet>>);

Example:

_selectWindow("Book1 - Excel");
_setSelectedExcelTab("Sheet2");   // selects "Sheet2" tab in Book1 - Excel.


Windows Data Manipulation

_setCell

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

Available for modes: Windows

_setCell($element, $value)

Arguments
$elementWindows element cell whose value is to be set
$valuestring Value to be set

Returns
null

Details

Value entered into the specified cell of the currently selected sheet Supports only cells within MS Excel framework
_setCell(<<cell identifier>>, <<value>>);

Example:

_setCell("A22","test");


_typeCell

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

Available for modes: Windows

_typeCell($element, $value)

Arguments
$elementWindows element cell element in which the text is to be typed
$valuestring Value to be set

Returns
null

Details

Value appended to the specific cell of the currently selected sheet Supports only cells within MS Excel framework
_typeCell(<<cell identifier>>, <<value>>);

Example:

_typeCell("A22","test");


Windows Mouse Events

_drag

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

Available for modes: Windows

_drag($dragElement)

Arguments
$dragElementWindows element element to be dragged

Returns
null

Details

Simulates a drag action
// Drag the item
_drag(_image("item.jpg"));


_drop

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

Available for modes: Windows

_drop($dropElement)

Arguments
$dropElementWindows element where the dragged element will be dropped

Returns
null

Details

Simulates a drag and drop action
// Drop it at images folder
_drop(_listitem("images"));


// drag and drop action on same window
_selectWindow("Source Window");
_drag(_image("item.jpg"));
_drop(_listitem("images"));

// drag and drop action on different window
_selectWindow("Source Window");
_drag(_image("item.jpg"));
_selectWindow("Destination Window");
_drop(_listitem("images"));