#=============================================================================================
# @TITLE			5. Step DBM Wizard.
#
# @NUMBER			DBM2_FKT_02006
#
# @DESCRIPTION		Clicking 'Back' and checking the window content. Then 'Next' and again
# @					checking window content. Selecting the 'Instance Type' to install and
# @					going 'Next'.
#
# @EXP_RESULT		'Dababase Version' step.
#
# @REQUIREMENTS		"Database Manager" is installed.
#=============================================================================================
TestName = "DBM2_FKT_02006";
static WizardOpen = 1;
#=============================================================================================
# @STEP 1			Going back and checking window content.
#=============================================================================================
if (win_exists("Database Manager Installation Wizard") == 0) {

	set_window ("Database Manager Installation Wizard", 2);
	button_press ("< Back");
	
	wait(2);
	
	ActiveX_get_info("DBMWfr2.Framework", "HeaderTitle", Header);
	
	if (Header == "Parameter Initialization") {		
		tl_step ("Installation wizard - 'Parameter Initialization' - 'Next'", "0", "Window is correct. - TN: " & TestName);
	} else {		
		tl_step ("Installation wizard - 'Parameter Initialization' - 'Next'", "1", "Window is incorrect. - TN: " & TestName);
	}
#=============================================================================================
# @STEP 2			Going next.
#=============================================================================================
	set_window ("Database Manager Installation Wizard", 2);
	button_press ("Next >");
	
	ActiveX_get_info("DBMWfr2.Framework", "HeaderTitle", Header);
	
	if (Header == "Instance Type") {		
		tl_step ("Installation wizard - 'Instance Type' - 'Next'", "0", "Window is correct. - TN: " & TestName);
	} else {		
		tl_step ("Installation wizard - 'Instance Type' - 'Next'", "1", "Window is incorrect. - TN: " & TestName);
	}
#=============================================================================================
# @STEP 3			Checking window content - Installation
#=============================================================================================		
	L_RC_1 = obj_exists("SAP DB OLTP",0);
	L_RC_2 = obj_exists("liveCache",0);
#	L_RC_3 = obj_exists("SAP DB Document Server",0);

	L_RC_7 = obj_exists ("< Back", 0);
	L_RC_8 = obj_exists ("Next >", 0);
	L_RC_9 = obj_exists ("Cancel", 0);
	
	if (L_RC_1 == 0 &&
		L_RC_2 == 0 &&
#		L_RC_3 == 0 &&
		L_RC_7 == 0 &&
		L_RC_8 == 0 &&
		L_RC_9 == 0) {
			
		tl_step("Installation Wizard - Parameter Initialization", "0", "All expected controls are displayed. - TN: " & TestName);
		
		obj_get_info ("SAP DB OLTP", "value", value1);
		obj_get_info ("liveCache", "value", value2);
#		obj_get_info ("SAP DB Document Server", "value", value3);
		
		if (value1 == 1 &&
			value2 == 0){
#			value2 == 0 &&
#			value3 == 0) {
			
			tl_step ("Installation Wizard - Parameter Initialization", "0", "All checked controls are in correct state. - TN: " & TestName);			
		} else {
			tl_step ("Installation Wizard - Parameter Initialization", "1", "At least one checked controls is in incorrect state. - TN: " & TestName);
			tl_step ("Installation Wizard - Parameter Initialization", "1", "SAP DB OLTP: " & value1 & " expected 1. - TN: " & TestName);
			tl_step ("Installation Wizard - Parameter Initialization", "1", "liveCache: " & value2 & " expected 0. - TN: " & TestName);
#			tl_step ("Installation Wizard - Parameter Initialization", "1", "SAP DB Document Server: " & value3 & " expected 0. - TN: " & TestName);
		}
#=============================================================================================
# @STEP 4			Going 'Next'
#=============================================================================================		
		set_window ("Database Manager Installation Wizard", 6);
		button_press ("Next >");
	} else {		
		tl_step("Installation Wizard - Database Name", "1", "Not all expected controls are displayed. - TN: " & TestName);
		set_window ("Database Manager Installation Wizard", 6);
		button_press ("Next >");
	}
} else {
	
	tl_step("Database Manager Installation Wizard - Window Check", "1", "Window not open. - TN: " & TestName);
	WizardOpen = 0;
}
