Windows APIs
Windows automation is supported since Sahi Pro Desktop Add-onWindows 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 Pro | Sahi OS | Sahi Pro Starter | Desktop Add-On | Mobile Add-On |
NA | NA | NA | 7.0.0 | NA |
Available for modes: Windows
_setSelectedExcelTab($element)
Arguments
$element | string | Excel Sheet. |
Returns
null |
Details
Select the specified sheet in Excel
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 Pro | Sahi OS | Sahi Pro Starter | Desktop Add-On | Mobile Add-On |
NA | NA | NA | 7.0.0 | NA |
Available for modes: Windows
_setCell($element, $value)
Arguments
$element | Windows element | cell whose value is to be set |
$value | string | 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
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 Pro | Sahi OS | Sahi Pro Starter | Desktop Add-On | Mobile Add-On |
NA | NA | NA | 7.0.0 | NA |
Available for modes: Windows
_typeCell($element, $value)
Arguments
$element | Windows element | cell element in which the text is to be typed |
$value | string | 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
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 Pro | Sahi OS | Sahi Pro Starter | Desktop Add-On | Mobile Add-On |
NA | NA | NA | 7.5.0 | NA |
Available for modes: Windows
_drag($dragElement)
Arguments
$dragElement | Windows element | element to be dragged |
Returns
null |
Details
Simulates a drag action
Simulates a drag action
// Drag the item
_drag(_image("item.jpg"));
_drop
Since: | Sahi Pro | Sahi OS | Sahi Pro Starter | Desktop Add-On | Mobile Add-On |
NA | NA | NA | 7.5.0 | NA |
Available for modes: Windows
_drop($dropElement)
Arguments
$dropElement | Windows | element where the dragged element will be dropped |
Returns
null |
Details
Simulates a drag and drop action
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"));