SapGuiTreeExpandNode Function

Action

Expands a specified node of a specified tree control.

Include file

SapGui.bdh

Syntax

SapGuiTreeExpandNode( in sControlId : string allownull,
                      in sNodeName  : string,
                      in sNode      : string,
                      in sTimer     : string optional ) : boolean;
Parameter Description
sControlId The tree's unique id.
sNodeName The name of the node to be expanded. Silk Performer will try to look up the node by matching the node name. If it cannot find the node by the name or if the name is not unique, specify the node id in the third parameter.
sNode The node id identifying the node.
sTimer Timer name used for measurements.

Return value

  • true if successful
  • false otherwise

Example

transaction TMain
 var
    sConnID : string;
  begin
    // Connecting to SAP
    sConnID := SapGuiOpenConnection(" /SAP_CODEPAGE=1100 /FULLMENU 10.5.2.198 0 /3");
    SapGuiSetActiveConnection(sConnID);
    SapGuiSetActiveSession("ses[0]");

    // SAP
    SapGuiSetActiveWindow("wnd[0]", "SAP", SAPGUI_MATCH_Exact);
    SapGuiWindowAction(SAPGUI_WND_MAXIMIZE);

    // Logon to SAP System
    // Before running a test you have to customize the password parameter!
    SapGuiIgnoreError(SAPENGINE_STATUSBAR_CHANGED, SEVERITY_SUCCESS);
    ThinkTime(3.2);
    SapGuiLogon("ddic", "minisap", "000", "");

    // Copyright
    ThinkTime(2.2);
    SapGuiSetActiveWindow("wnd[1]", "Copyright", SAPGUI_MATCH_Exact);
    SapGuiPressButton("tbar[0]/btn[0]");

    // SAP Easy Access
    ThinkTime(3.8);
    SapGuiSetActiveWindow("wnd[0]", "SAP Easy Access", SAPGUI_MATCH_Exact);

    // NodeName: Office
    // NodePath: 2\1
    SapGuiTreeExpandNode("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "Office", "0000000003", "Expand\\Office");
  end TMain;