Sets the active window for the virtual users. Any subsequent SapGui calls will be performed on the active window. This function also allows window title verifications.
SapGui.bdh
SapGuiSetActiveWindow( in sWindowId : string, in sCaption : string optional, in nMatch : number optional ) : boolean;
Parameter | Description |
---|---|
sWindowId | Id uniquely identifying the window to be set as the active one. |
sCaption | Caption of the window. This parameter will be used to perform a window title verification. The caption may also be provided using wildcards or regular expressions. How the function will evaluate the caption has to be specified in the third parameter of the function. |
nMatch |
Method how to perform the title verification. Available options are:
|
transaction TMain
var
sId : string;
begin
// Connecting to SAP
sId := SapGuiOpenConnection(" /SAP_CODEPAGE=1100 /FULLMENU 10.5.2.198 0 /3");
SapGuiSetActiveConnection(sId);
SapGuiSetActiveSession("ses[0]");
// SAP
SapGuiSetActiveWindow("wnd[0]", "SAP", SAPGUI_MATCH_Exact);
SapGuiSetActiveWindow("wnd[0]", "S.*P", SAPGUI_MATCH_RegExp);
SapGuiSetActiveWindow("wnd[0]", "S?P", SAPGUI_MATCH_Wildcard);
SapGuiWindowResize(117, 28, false);
// Logon to SAP System
// Before running a test you have to customize the password parameter!
ThinkTime(5.3);
SapGuiLogon("bcuser", "*******", "000", "");
// Copyright
end TMain;