Skip to content

General Element Actions

sapFill

Since: 3.0

Description: Enter the value in the field.

Input Format: Value to enter (e.g., Test123)

ObjectName Action Input Condition Reference
SAP 🟢 sapFill @value ⬅ Hardcoded Input
SAP 🟢 sapFill Sheet:Column ⬅ Input from Datasheet
SAP 🟢 sapFill %dynamicVar% ⬅ Input from variable
@Action(object = ObjectType.SAP, desc = "Enter the value [<Data>] in the field [<Object>]", input = InputType.YES)
public void sapFill() {
    try {
        Dispatch.put(SAPelement, "Text", Data);
        Report.updateTestLog(Action, "Entered value [" + Data + "]", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to enter value. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapEnter

Since: 3.0

Description: Press Enter key in the field.

Input Format: None

ObjectName Action Input Condition Reference
SAP 🟢 sapEnter ⬅ No Input
@Action(object = ObjectType.SAP, desc = "Press [<Enter>] key", input = InputType.NO)
public void sapEnter() {
    try {
        Dispatch.call(SAPelement, "sendVKey", 0);
        Report.updateTestLog(Action, "Pressed Enter key", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to press Enter. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapClick

Since: 3.0

Description: Click/Press button.

Input Format: None

ObjectName Action Input Condition Reference
SAP 🟢 sapClick ⬅ No Input
@Action(object = ObjectType.SAP, desc = "Click the [<Object>]")
public void sapClick() {
    try {
        Dispatch.call(SAPelement, "press");
        Report.updateTestLog(Action, "Button clicked", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to click button. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapDoubleClick

Since: 3.0

Description: Double-click on element.

Input Format: None

ObjectName Action Input Condition Reference
SAP 🟢 sapDoubleClick ⬅ No Input
@Action(object = ObjectType.SAP, desc = "Double click on [<Object>]")
public void sapDoubleClick() {
    try {
        Dispatch.call(SAPelement, "doubleClick");
        Report.updateTestLog(Action, "Element double-clicked", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to double-click. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapPressButton

Since: 3.0

Description: Press button by ID or function code.

Input Format: Button ID or function code (e.g., SAVE)

ObjectName Action Input Condition Reference
SAP 🟢 sapPressButton @value ⬅ Hardcoded Input
SAP 🟢 sapPressButton Sheet:Column ⬅ Input from Datasheet
SAP 🟢 sapPressButton %dynamicVar% ⬅ Input from variable
@Action(object = ObjectType.SAP, desc = "Press button with ID [<Data>]", input = InputType.YES)
public void sapPressButton() {
    try {
        Dispatch.call(SAPtoolbar, "pressButton", Data);
        Report.updateTestLog(Action, "Pressed button with ID [" + Data + "]", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to press button. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapSetFocus

Since: 3.0

Description: Set focus on element.

Input Format: None

ObjectName Action Input Condition Reference
SAP 🟢 sapSetFocus ⬅ No Input
@Action(object = ObjectType.SAP, desc = "Set focus on [<Object>]", input = InputType.NO)
public void sapSetFocus() {
    try {
        Dispatch.call(SAPelement, "setFocus");
        Report.updateTestLog(Action, "Focus set on element", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to set focus. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapMaximizeWindow

Since: 3.0

Input Format: None

ObjectName Action Input Condition Reference
SAP 🟢 sapMaximizeWindow ⬅ No Input
@Action(object = ObjectType.SAP, desc = "Maximize SAP window [<Object>]", input = InputType.NO)
public void sapMaximizeWindow() {
    try {
        Dispatch.call(SAPwindow, "Maximize");
        Report.updateTestLog(Action, "Window maximized", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to maximize window. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapMinimizeWindow

Since: 3.0

Description: Minimize SAP window.

Input Format: None

ObjectName Action Input Condition Reference
SAP 🟢 sapMinimizeWindow ⬅ No Input
@Action(object = ObjectType.SAP, desc = "Minimize SAP window [<Object>]", input = InputType.NO)
public void sapMinimizeWindow() {
    try {
        Dispatch.call(SAPwindow, "Minimize");
        Report.updateTestLog(Action, "Window minimized", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to minimize window. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapRestoreWindow

Since: 3.0

Description: Restore SAP window to normal size.

Input Format: None

ObjectName Action Input Condition Reference
SAP 🟢 sapRestoreWindow ⬅ No Input
@Action(object = ObjectType.SAP, desc = "Restore SAP window [<Object>] to normal size", input = InputType.NO)
public void sapRestoreWindow() {
    try {
        Dispatch.call(SAPwindow, "Restore");
        Report.updateTestLog(Action, "Window restored", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to restore window. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapExpandTreeNode

Since: 3.0

Description: Expand tree node.

Input Format: Node key

ObjectName Action Input Condition Reference
SAP 🟢 sapExpandTreeNode @value ⬅ Hardcoded Input
SAP 🟢 sapExpandTreeNode Sheet:Column ⬅ Input from Datasheet
SAP 🟢 sapExpandTreeNode %dynamicVar% ⬅ Input from variable
@Action(object = ObjectType.SAP, desc = "Expand tree node [<Data>]", input = InputType.YES)
public void sapExpandTreeNode() {
    try {
        Dispatch.call(SAPtree, "ExpandNode", Data);
        Report.updateTestLog(Action, "Expanded tree node [" + Data + "]", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to expand tree node. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapCollapseTreeNode

Since: 3.0

Description: Collapse tree node.

Input Format: Node key

ObjectName Action Input Condition Reference
SAP 🟢 sapCollapseTreeNode @value ⬅ Hardcoded Input
SAP 🟢 sapCollapseTreeNode Sheet:Column ⬅ Input from Datasheet
SAP 🟢 sapCollapseTreeNode %dynamicVar% ⬅ Input from variable
@Action(object = ObjectType.SAP, desc = "Collapse tree node [<Data>]", input = InputType.YES)
public void sapCollapseTreeNode() {
    try {
        Dispatch.call(SAPtree, "CollapseNode", Data);
        Report.updateTestLog(Action, "Collapsed tree node [" + Data + "]", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to collapse tree node. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapGetStatusBarText

Since: 3.0

Description: Get status bar text.

Input Format: None

ObjectName Action Input Condition Reference
SAP 🟢 sapGetStatusBarText ⬅ No Input
@Action(object = ObjectType.SAP, desc = "Get status bar text from [<Object>]", input = InputType.NO)
public void sapGetStatusBarText() {
    try {
        String text = Dispatch.get(SAPstatusBar, "Text").toString();
        Report.updateTestLog(Action, "Status bar text: " + text, Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to get status bar text. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapPressContextButton

Since: 3.0

Description: Press context button with parameter.

Input Format: Button ID

ObjectName Action Input Condition Reference
SAP 🟢 sapPressContextButton @value ⬅ Hardcoded Input
SAP 🟢 sapPressContextButton Sheet:Column ⬅ Input from Datasheet
SAP 🟢 sapPressContextButton %dynamicVar% ⬅ Input from variable
@Action(object = ObjectType.SAP, desc = "Press context button with parameter [<Data>]", input = InputType.YES)
public void sapPressContextButton() {
    try {
        Dispatch.call(SAPelement, "pressContextButton", Data);
        Report.updateTestLog(Action, "Pressed context button [" + Data + "]", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to press context button. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapOpenComboBox

Since: 3.0

Description: Open dropdown list.

Input Format: None

ObjectName Action Input Condition Reference
SAP 🟢 sapOpenComboBox ⬅ No Input
@Action(object = ObjectType.SAP, desc = "Open dropdown [<Object>]", input = InputType.NO)
public void sapOpenComboBox() {
    try {
        Dispatch.call(SAPcomboBox, "Open");
        Report.updateTestLog(Action, "Dropdown opened", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to open dropdown. Error: " + e.getMessage(), Status.FAILNS);
    }
}

sapCloseComboBox

Since: 3.0

Description: Close dropdown list.

Input Format: None

ObjectName Action Input Condition Reference
SAP 🟢 sapCloseComboBox ⬅ No Input
@Action(object = ObjectType.SAP, desc = "Close dropdown [<Object>]", input = InputType.NO)
public void sapCloseComboBox() {
    try {
        Dispatch.call(SAPcomboBox, "Close");
        Report.updateTestLog(Action, "Dropdown closed", Status.DONE);
    } catch (Exception e) {
        Report.updateTestLog(Action, "Failed to close dropdown. Error: " + e.getMessage(), Status.FAILNS);
    }
}