Verifies whether a SapGui control exists and can be accessed during a test run.
SapGui.bdh
SapGuiVerifyObjectAvailability( in sControlId : string, in bAbsolutePath : boolean optional, in nSeverity : number optional := SEVERITY_ERROR ) : boolean;
Parameter | Description |
---|---|
sControlId | The unique id of the SapGui control. |
bAbsolutePath | If set to true, the id of the control has to be specified using the absolute path. This includes the connection, session, window and control id. Otherwise the verification will be performed looking up the control in the active session. |
nSeverity |
Optional: Severity of the error that is raised if the verification fails. Can be one of the following values:
|
transaction TMain
var
sText : string;
sConnID : string;
begin
// Connecting to SAP
sConnID := SapGuiOpenConnection( " /SAP_CODEPAGE=1100 /FULLMENU 10.5.2.132 0 /3");
SapGuiSetActiveConnection(sConnID);
SapGuiSetActiveSession("ses[0]");
// SAP
SapGuiSetActiveWindow("wnd[0]", "SAP", SAPGUI_MATCH_ExactNoCase);
SapGuiWindowAction(SAPGUI_WND_MAXIMIZE);
// Logon to SAP System
// Before running a test you have to customize the password parameter!
ThinkTime(2.0);
SapGuiLogon("ddic", "minisap", "000", "");
SapGuiVerifyObjectAvailability("tab[0]/btn1", false, SEVERITY_ERROR);
end TMain;