#=============================================================================================
# @TITLE			7. Step DBM Wizard.
#
# @NUMBER			DBM2_FKT_02008
#
# @DESCRIPTION		Going back to parameter adjust and checking whether param session still
# @					exists.
#
# @EXP_RESULT		'Dababase Version' step.
#
# @REQUIREMENTS		"Database Manager" is installed.
#=============================================================================================
TestName = "DBM2_FKT_02008";
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 == "Adjust Parameters") {		
		tl_step ("Installation wizard - 'Adjust Parameters' - 'Back'", "0", "Window is correct. - TN: " & TestName);
	} else {		
		tl_step ("Installation wizard - 'Adjust Parameters' - 'Back'", "1", "Window is incorrect. - TN: " & TestName);
	}
#=============================================================================================
# @STEP 2			Changing first parameter just to see whether param session still exists.
#=============================================================================================
	value = "a";
	i = 0;
	
	while (is_numeric (value) != -1) {
		
		set_window ("Database Manager Installation Wizard", 2);
		list_get_item ("lvwParameters", i, item);
		list_select_item("lvwParameters", item, LEFT, 0);
	
		toolbar_button_press ("msvb_lib_toolbar", "Properties");
		
		set_window ("Parameter Properties", 1);
		obj_get_info ("txtValue", "text", value);
		
		if (item == "DATA_CACHE") {			
			value = "a";
		}
		
		button_press ("Cancel");
		i++;
	}	
	set_window ("Database Manager Installation Wizard", 2);
	list_select_item ("lvwParameters", item, LEFT, 0);
		
	toolbar_button_press ("msvb_lib_toolbar", "Properties");
	
	set_window ("Parameter Properties", 1);
	edit_set ("txtNewValue", value + 1);
	
	button_press ("OK");
	
	if (win_exists("Error",0) == 0) {
						
		tl_step ("Parameter check - param session","1","Error occured. - TN: " & TestName);
	
		set_window ("Error", 1);
		button_press ("OK");
		
		set_window ("Parameter Properties", 1);
		button_press ("Cancel");
	} else {
		
		tl_step ("Parameter check - param session","0","Error did not occure. - TN: " & TestName);
		
		set_window ("Database Manager Installation Wizard", 2);
		list_select_item ("lvwParameters", item, LEFT, 0);
			
		toolbar_button_press ("msvb_lib_toolbar", "Properties");
		
		set_window ("Parameter Properties", 1);
		edit_set ("txtNewValue", value);
		
		button_press ("OK");
	}
#=============================================================================================
# @STEP 3			Going 'Next'.
#=============================================================================================		
	set_window ("Database Manager Installation Wizard", 2);
	button_press ("Next >");	
	wait(2);
} else {
	
	tl_step("Database Manager Installation Wizard - Window Check", "1", "Window not open. - TN: " & TestName);
	WizardOpen = 0;
}
