#=============================================================================================
# @TITLE			Start DBM GUI.
#
# @NUMBER			DBM3_OpenClose_001_OpenDBMGUI
#
# @DESCRIPTION		The dbmgui.exe application get started.
#
# @EXP_RESULT		The "database manager" window opens.
#
# @REQUIREMENTS		"Database Manager" is installed.
#=============================================================================================
static TestName = "DBM3_OpenClose_001_OpenDBMGUI";

#=============================================================================================
# @STEP 1			Starting application.
#=============================================================================================

test = invoke_application (tools_dir & "DBMGui3.exe", "", "", SW_SHOW);

if (win_exists("Database Manager", 30) == E_OK) {

	tl_step ("DBM-GUI has been started",0,"Testname: " & TestName & ", Line:" & getvar("line_no"));

	win_get_info ("Database Manager", "x", pos_x);
	win_get_info ("Database Manager", "y", pos_y);
	
	#sync server
	set_window ("SAP DB Database Manager", 4);
	list_select_item ("tvwFolders", "Servers;<Local>"); 
	list_select_item ("tvwFolders", "Servers;<Local>", RIGHT);
	#select menu item -syncerver- via shortcut S(y)nc server;
	type("Y"); 
	
	wait(5);

	if (pox_x != 0 || pos_y != 0)
	{
		win_move ("Database Manager", 0, 0);
	}
	
	win_get_info ("Database Manager", "width", width);
	win_get_info ("Database Manager", "height", height);
	
	if (width != 1024 || height != 768) {
		win_resize ("Database Manager", 1024, 768);
	}
} else {

	tl_step ("DBM-GUI has not been started",1,"Testname: " & TestName & ", Line:" & getvar("line_no"));
	GUIStarted = 0;
}
