<head></head><body><pre></font><font color="#ff0000"><i>################################################################################</font></i><font color=black>
</font><font color="#ff0000"><i># LIBRARY:	AUT_lib</font></i><font color=black>
</font><font color="#ff0000"><i>################################################################################</font></i><font color=black>
</font><font color="#ff0000"><i># $Revision: 1.2 $</font></i><font color=black>
</font><font color="#ff0000"><i># $Author: drajovic $</font></i><font color=black>
</font><font color="#ff0000"><i># $Date: 2002/12/16 18:34:45 $</font></i><font color=black>
</font><font color="#ff0000"><i># $Source: d:/Archive/CVS_QS/EMOS/EMOS_FRM_EXAMPLES/FlightDemo/Scripts/LIB/AUT_lib/script,v $</font></i><font color=black>
</font><font color="#ff0000"><i># $NoKeywords: $</font></i><font color=black>
</font><font color="#ff0000"><i>################################################################################</font></i><font color=black>

</font><font color="#ff0000"><i>#</font></i><font color=black></font><font color="#ff0000"><i>/***
#* This library contains application-specific routines such as
#* synchronisation with status object or setting up the typical 
#* initial state (new order).
#*/</font></i><font color=black>

</font><font color="#ff0000"><i>#</font></i><font color=black></font><font color="#ff0000"><i>/**
#* Invokes the AUT
#* @return E_OK on success otherwise !E_OK
#*/</font></i><font color=black>

<b>public</b> <b>function</b> AUT_invoke ( )
{
    <b>auto</b> rc;
	<b>auto</b> home = </font><font color="#00bb00">"http://mercurytours.mercuryinteractive.com/"</font><font color=black>;
	<b>auto</b> browser = getenv( </font><font color="#00bb00">"BROWSER"</font><font color=black> );
	
	rc = web_browser_invoke( (!browser*1 ? IE : browser), home );
	rc+= set_window( </font><font color="#00bb00">"Login"</font><font color=black>, 30 );
	
    <b>return</b> rc;
}


</font><font color="#ff0000"><i>#</font></i><font color=black></font><font color="#ff0000"><i>/**
#*	Closes the AUT
#*/</font></i><font color=black>

<b>public</b> <b>function</b> AUT_close ()
{
	<b>auto</b> rc;
	<b>static</b> wins[] = {
		</font><font color="#00bb00">"MessageBox"</font><font color=black>
		,</font><font color="#00bb00">"Browser"</font><font color=black>
	};
	AUT_reset();
	rc = EMOS_win_close_all( wins );
	<b>if</b> ( rc != E_OK )
		AUT_kill();
}


</font><font color="#ff0000"><i>#</font></i><font color=black></font><font color="#ff0000"><i>/**
#* Closes all windows other than main application window.
#* @return E_OK if set_window() succeeded on main window else !E_OK
#*/</font></i><font color=black>

<b>public</b> <b>function</b> AUT_reset ()
{
	<b>return</b> E_OK;
}


</font><font color="#ff0000"><i>#</font></i><font color=black></font><font color="#ff0000"><i>/**
#*	Kills the AUT (via Task Manager or so).
#*/</font></i><font color=black>

<b>public</b> <b>function</b> AUT_kill ()
{
	</font><font color="#ff0000"><i># your code here</font></i><font color=black>
}


</font><font color="#ff0000"><i># Sicherheitshinweis</font></i><font color=black>
<b>public</b> <b>function</b> close_security_alerts()
{
	<b>auto</b> again, hit;
	<b>auto</b> rc, ex;
	</font><font color="#ff0000"><i># maximum of ten etemps</font></i><font color=black>
	again=10;

	set_timeout( 1 );
</font><font color="#ff0000"><i>#	printf( "Close unwanted windows" );</font></i><font color=black>
	<b>while</b>( again &gt; 0)
	{
		hit=0;
		ex=win_exists( </font><font color="#00bb00">"SecurityAlert"</font><font color=black> );
</font><font color="#ff0000"><i>#		report_msg( "exists 2:"&amp; ex );</font></i><font color=black>
		<b>if</b>( ex == E_OK )
		{
			rc=win_activate( </font><font color="#00bb00">"SecurityAlert"</font><font color=black> );
			rc=set_window( </font><font color="#00bb00">"SecurityAlert"</font><font color=black> );
			<b>if</b> ( obj_exists( </font><font color="#00bb00">"No"</font><font color=black> ) == E_OK )
				rc=button_press( </font><font color="#00bb00">"No"</font><font color=black> );
			<b>else</b> <b>if</b> ( obj_exists( </font><font color="#00bb00">"OK"</font><font color=black> ) == E_OK )
				rc=button_press( </font><font color="#00bb00">"OK"</font><font color=black> );
			<b>else</b>
				rc=win_close( </font><font color="#00bb00">"SecurityAlert"</font><font color=black> );
			hit=1;
		}
		<b>if</b>( hit != 0 )
		{
			again--;
			wait( 1 );
		}
		<b>else</b>
			again=0;
	} 
	restore_timeout();
}
</pre></body>