[Http-webtest-general] Re: control the test flow in wtscript?
Brought to you by:
m_ilya,
richardanderson
From: <u.b...@gm...> - 2003-01-28 17:28:37
|
> UB> <example_code> > UB> $webtest->run_wtscript('case1'); > UB> my $content = $webtest->current_response->content; > UB> my ( $Next_Start_URL ) = $content =~ /action='(.+?)'/; > UB> if ( $content =~ /something/ ) { > UB> $webtest->run_wtscript('case2.1'); > UB> } > UB> else { > UB> $webtest->run_wtscript('case2.2'); > UB> } > UB> </example_code> > > UB> is there a possibility to make the $Next_Start_URL > UB> available in the lateron called wtscripts case2.1 > UB> or case2.2? > > You can use global vars to pass this information into the next test > case: > > test_name = N/A > url = "$main::Next_Start_URL" > end_test > > this example assumes that $Next_Start_URL is declared in package main > and it is a global var (i.e. not 'my'). at least for my special question also $webtest->run_wtscript('case2.1', { url => $Next_Start_URL} ); will work (I found out), but your solution is more general and can be used for passing any variables thanks for the fast help, Udo -- +++ GMX - Mail, Messaging & more http://www.gmx.net +++ NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen! |