SapGuiTreeNodeContextMenu Function

Action

Opens a context menu for the specified tree node.

Include file

SapGui.bdh

Syntax

SapGuiTreeNodeContextMenu( 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 for which the context menu should be opened. 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 /H/195.61.176.22/H/194.117.106.130/S/3297/H/cpce601 13 /3");
    SapGuiSetActiveConnection(sConnID);
    SapGuiSetActiveSession("ses[0]");

    // SAP R/3
    SapGuiSetActiveWindow("wnd[0]", "SAP R/3", 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(2.6);
    SapGuiLogon("sapuser", "****", "850", "");

    // System Messages
    ThinkTime(7.0);
    SapGuiSetActiveWindow("wnd[1]", "System Messages", SAPGUI_MATCH_Exact);
    SapGuiPressButton("tbar[0]/btn[0]");

    // SAP Easy Access - User menu for Partner #999999
    ThinkTime(102.6);
    SapGuiSetActiveWindow("wnd[0]", "SAP Easy Access - User menu for Partner #999999", SAPGUI_MATCH_Exact);

    // NodeName: User menu for Partner #999999
    // NodePath: 2
    SapGuiTreeSelectNode("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "User menu for Partner #999999",
    "Root", false, "SelNode\\User menu for Partner #999999");

    // NodeName: User menu for Partner #999999
    // NodePath: 2
    SapGuiTreeDblClickNode("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "User menu for Partner #999999",
    "Root", "DblClNode\\User menu for Partner #999999");

    // NodeName: Favorites
    // NodePath: 1
    ThinkTime(11.1);
    SapGuiTreeSelectNode("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "Favorites", "Favo", false, 
    "SelNode\\Favorites");

    // NodeName: Favorites
    // NodePath: 1
    SapGuiTreeDblClickNode("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "Favorites", "Favo", "DblClNode\\Favorites");

    // NodeName: Office
    // NodePath: 2\1
    ThinkTime(11.5);
    SapGuiTreeExpandNode("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "Office", "0000000005", "Expand\\Office");

    // NodeName: Telephone Integration
    // NodePath: 2\1\2
    SapGuiTreeExpandNode("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "Telephone Integration",
    "0000000007", "Expand\\Telephone Integration");

    // NodeName: Own Telephone Number
    // NodePath: 2\1\2\1
    SapGuiTreeSelectNode("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "Own Telephone Number", "0000000008", 
    false, "SelNode\\Own Telephone Number");

    // NodeName: Favorites
    // NodePath: 1
    SapGuiSelectTopNode("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "Favorites", "Favo", "TopNode\\Favorites");

    // NodeName: Own Telephone Number
    // NodePath: 2\1\2\1
    SapGuiTreeNodeContextMenu("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "Own Telephone Number", "0000000008" ,
    "NodeCtxt\\Own Telephone Number");

    SapGuiIgnoreError(SAPENGINE_STATUSBAR_CHANGED, SEVERITY_SUCCESS);
    ThinkTime(5.6);
    SapGuiContextMenuSelectItem("usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell", "XXECK1");

    // StatusBar(Msg/Id/Type/No): No documentation exists for program RSPHSPHD/26363088/S/035
  end TMain;