Windows APIs
Windows automation is supported since Sahi Pro Desktop Add-on_setSelectedExcelTab
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 7.0.0 | NA | NA | NA |
Available for modes: Windows
_setSelectedExcelTab($element)
Arguments
$element | string | Excel Sheet. |
Returns
null |
Sahi Pro Flowcharts Action :Set Selected Excel Tab
Details
Select the specified sheet in Excel
Select the specified sheet in Excel
_selectWindow("Book1 - Excel");
_setSelectedExcelTab("Sheet2"); // selects "Sheet2" tab in Book1 - Excel.
_setCell
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 7.0.0 | NA | NA | 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 |
Sahi Pro Flowcharts Action :Set Cell
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("A22","test");
_typeCell
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 7.0.0 | NA | NA | 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 |
Sahi Pro Flowcharts Action :Type Cell
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("A22","test");
_drag
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 7.5.0 | NA | NA | NA |
Available for modes: Windows
_drag($dragElement)
Arguments
$dragElement | Windows element | element to be dragged |
Returns
null |
Sahi Pro Flowcharts Action :Drag
Details
Simulates a drag action
Simulates a drag action
// Drag the item
_drag(_image("item.jpg"));
_drop
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 7.5.0 | NA | NA | NA |
Available for modes: Windows
_drop($dropElement)
Arguments
$dropElement | Windows | element where the dragged element will be dropped |
Returns
null |
Sahi Pro Flowcharts Action :Drop
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"));
NX APIs
_attachExe
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 8.0.0 | NA | NA | NA |
Available for modes: Windows
_attachExe($exeArgs, $arch)
Arguments
$exeArgs | string | path of the application including command line arguments. |
$arch | integer | architecture of the executable program. Can be either 32 or 64. |
Returns
null |
Sahi Pro Flowcharts Action :Attach Exe
Details
Launches application with NX extension DLL for the specified architecture of a control in a window.
Launches application with NX extension DLL for the specified architecture of a control in a window.
_attachExe("app.exe",32);
_attachExe("app.exe -someOption=1",32);
_attach
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 8.0.0 | NA | NA | NA |
Available for modes: Windows
_attach($x, $y, $arch)
Arguments
$x | integer | x-coordinate of the control |
$y | integer | y-coordinate of the control |
$arch | integer | architecture of the executable program. Can be either 32 or 64 |
Returns
null |
Sahi Pro Flowcharts Action :Attach
Details
Attaches the NX extension DLL for the specified coordinates and architecture of a control in a window.
Attaches the NX extension DLL for the specified coordinates and architecture of a control in a window.
info
Note: To make the _attach API work it is required to start the SahiWinNX.exe or SahiWinNX64.exe under SAHI_INSTALLATION/windows/bin directory.
info
Note: Use this API only if you don't have access to the application's executable file or the application doesn't have an executable format.
_selectWindow("Application window name");
$pos = _position(_pane("Custom1"));
_attach($pos[0],$pos[1],32);
_capture
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 8.0.0 | NA | NA | NA |
Available for modes: Windows
_capture($x, $y)
Arguments
$x | integer | x-coordinate of the control |
$y | integer | y-coordinate of the control |
Returns
null |
Sahi Pro Flowcharts Action :Capture
Details
Starts capturing native text API calls for the specified coordinates of a control in a window.
Starts capturing native text API calls for the specified coordinates of a control in a window.
_attachExe("app.exe",32);
_selectWindow("windowName");
$pos = _position(_pane("Custom1"));
_capture($pos[0],$pos[1]);
_wait(2000); // specify wait for the NX extension to capture adequate UI render calls
_stopCapture();
warning
Note: You must call the
_stopCapture
API to stop the capture process after _capture
API call.
_captureUI
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 8.0.0 | NA | NA | NA |
Available for modes: Windows
_captureUI($windowName, $control[, $duration])
Arguments
$windowName | string | name of the application window |
$control | string | name of the control inside the window |
$duration | integer optional | duration for capturing UI render calls in milliseconds |
Returns
null |
Sahi Pro Flowcharts Action :Capture UI
Details
Starts capturing native text API calls for the specified coordinates of a control in a window.
Starts capturing native text API calls for the specified coordinates of a control in a window.
_attachExe("app.exe",32);
_captureUI("windowName", "custom1");
_captureUI("windowName", "custom1", 5000);
info
Note: The
_stopCapture()
API is not necessary after the _captureUI
API.
_stopCapture
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 8.0.0 | NA | NA | NA |
Available for modes: Windows
_stopCapture()
Arguments
None |
Returns
null |
Sahi Pro Flowcharts Action :Stop Capture
Details
Stops capturing UI render calls. Contructs the NX psuedo-element tables after this call.
Stops capturing UI render calls. Contructs the NX psuedo-element tables after this call.
_selectWindow("windowName");
var $pos = _position(_pane("Custom1"));
_attach($pos[0],$pos[1],32);
_capture($pos[0],$pos[1]);
_wait(2000); // specify wait for the NX extension to capture adequate UI render calls
_stopCapture();
_nxTableCount
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 8.0.0 | NA | NA | NA |
Available for modes: Windows
_nxTableCount()
Arguments
None |
Returns
integer | Number of tables rendered from NX |
Sahi Pro Flowcharts Action :Nx Table Count
Details
Gets the number of tables.
Gets the number of tables.
//example using _capture API
_selectWindow("windowName");
var $pos = _position(_pane("Custom1"));
_attach($pos[0],$pos[1],32);
_capture($pos[0],$pos[1]);
_wait(2000); // specify wait for the NX extension to capture adequate UI render calls
_stopCapture();
var $noOfTables = _nxTableCount();
//example using _captureUI
_selectWindow("windowName");
var $pos = _position(_pane("Custom1"));
_attach($pos[0],$pos[1],32);
_captureUI("windowName", "custom1");
var $noOfTables = _nxTableCount();
_nxTable
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 8.0.0 | NA | NA | NA |
Available for modes: Windows
_nxTable($table)
Arguments
$table | integer | Index of the table for getting the table data |
Returns
object | Table data containing rows and cells |
Sahi Pro Flowcharts Action :Nx Table
Details
Gets the table data for a given table index.
Gets the table data for a given table index.
_selectWindow("windowName");
var $pos = _position(_pane("Custom1"));
_attach($pos[0],$pos[1],32);
_capture($pos[0],$pos[1]);
_stopCapture();
var $table = _nxTable(0);
/* returns [[{"text":"&File","x":687,"y":387,"tab":0,"row":0,"col":0}
,{"text":"&Edit","x":719,"y":387,"tab":0,"row":0,"col":1}
,{"text":"&Options","x":753,"y":387,"tab":0,"row":0,"col":2}
,{"text":"&Help","x":809,"y":387,"tab":0,"row":0,"col":3}]] */
_nxCell
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
NA | 8.0.0 | NA | NA | NA |
Available for modes: Windows
_nxCell($row, $column, $table)
Arguments
$row | integer | Index of the row |
$column | integer | Index of the column |
$table | integer | Index of the table |
Returns
object | cell data |
Sahi Pro Flowcharts Action :Nx Cell
Details
Gets the cell data for given row, column and table index.
Gets the cell data for given row, column and table index.
_selectWindow("MFC Grid Control Demo");
var $pos = _position(_pane("Custom1"));
_attach($pos[0],$pos[1],32);
_caputureUI("windowName", "control");
var $cell = _nxCell(0,0,0); // returns {"text":"&File","x":687,"y":387,"tab":0,"row":0,"col":0}