#=============================================================================================
# @TITLE			Start Service - Web DBM.
#
# @NUMBER			WDBM_FKT_00100
#
# @DESCRIPTION		The service in the WebAgent for Web DBM get started here.
#
# @EXP_RESULT		The service is running.
#
# @REQUIREMENTS		Test: WDBM_FKT_01000;
#=============================================================================================

#=============================================================================================
# @STEP 1			Setting http:// - path.
#=============================================================================================
win_activate (browser_window_name);
set_window (browser_window_name);

obj_type ("browser_main_edit_location", url_waadmin);
obj_type ("browser_main_edit_location","<kReturn>");

if (win_exists("Enter Network Password", 1) == 0) {

	set_window ("Enter Network Password", 1);
	edit_set ("User Name", "admin");				# admin
	password_edit_set("Password", "ozatjzns");		# init
	button_press ("OK");
}

if (win_exists("Connect...", 1) == 0) {

	set_window ("Connect...", 1);
	edit_set ("browser_main_edit_location", "admin");	# admin
	password_edit_set("Password:", "ozatjzns");			# init
	button_press ("OK");
}
#=============================================================================================
# @STEP 2			Checking navigation tree.
#=============================================================================================
set_window (navi_window, 2);

if (obj_exists("webdbm",0) == 0) {
	web_link_click("webdbm");
} else {
	web_link_click("Services");
	wait(2);
	web_link_click("webdbm");
}
#=============================================================================================
# @STEP 3			Start service.
#=============================================================================================
set_window(detail_window, 1);

if (obj_exists("Load Service",0) == 0) {
	set_window (detail_window, 3);
	web_link_click("Load Service");
	
	wait(5);
	
	set_window (detail_window, 3);

	if (obj_exists("Start Service",0) == 0) {
		tl_step("Service started","0","ok");
	}
} else {	
	if (obj_exists("Start Service",0) == 0) {
		tl_step("Service already started","0","ok");
	}
}
#=============================================================================================
# @STEP 4			Enter of the address in the browser.
#=============================================================================================
set_window (browser_window_name);
obj_type ("browser_main_edit_location", url_webdbm);
obj_type ("browser_main_edit_location","<kReturn>");
#=============================================================================================
# @STEP 5			Checking the prompt.
#=============================================================================================
if (win_exists(main_window,0) == 0) {
	tl_step ("Main - Logon - Window","0","displayed");
} else {
	tl_step ("Main - Logon - Window","0","not displayed");
}
