Re: [Http-webtest-general] on_response question
Brought to you by:
m_ilya,
richardanderson
From: Gerry F. <ga...@cs...> - 2003-04-01 11:34:49
|
Illa, Being kinda new to this stuff, I have a follow up question. Isn't it also necessary for the second case to contain an anonymous function as well, so $SID is evaluated at runtime, rather than at load? e.g. sessionID => $SID should really be sessionID => sub { $SID } Gerry On Tue, 01 Apr 2003 14:36:05 +0400 Ilya Martynov <il...@ip...> wrote: > >>>>> "RB" == Remo Behn <fo...@we...> writes: > > RB> hi @all > > RB> sorry for my possibly stupid question > > RB> i have the follow test case > > RB> --------- > RB> test_name = 'login with as admin (EN)' > RB> url = http://localhost/app/login.pl > RB> click_button = Login > RB> params = ( > RB> uid => admin > RB> passwd => foobar > RB> doit => login > RB> lang => EN > RB> ) > RB> #-- get sessionID > RB> on_response = { > RB> my $webtest = shift; > RB> ($SID) = > RB> $webtest->current_response()->headers->{refresh};$SID > RB> =~ s/.*sessionID=([\d\w]+).*/$1/; > RB> []; > RB> } > RB> end_test > > RB> [..snip..] > > RB> why that does not do ? > RB> $SID isn't set ;((( > > RB> [..snip..] > > $webtest->current_response->headers > > Returns HTTP::Headers object which has other API then you are using. > > Instead of > > $webtest->current_response->headers->{refresh} > > you should write > > $webtest->current_response->headers->header('refresh'); > > See perldoc HTTP::Headers for details. > > Moreover HTTP::Request object ($webtest->current_response) have some > shortcuts to access headers. You can rewrite code above to > > $webtest->current_response->header('refresh'); > > See perldoc HTTP::Message for details (this is a base class of > HTTP::Request) > > > -- > Ilya Martynov, il...@ip... > CTO IPonWEB (UK) Ltd > Quality Perl Programming and Unix Support > UK managed @ offshore prices - http://www.iponweb.net > Personal website - http://martynov.org > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > Http-webtest-general mailing list > Htt...@li... > https://lists.sourceforge.net/lists/listinfo/http-webtest-general -- Gerry Finkel phone (732)302-0222 ext. 6614 ga...@cs... fax (732)302-0799 MQSS pager (800) 759-8888 pin 1909963 As often happens, once we had a few songs finished that we liked, the newer ones started to get weirder. Daring grows out of confidence (or what the ancient Greeks called "hubris," I guess). Neil Peart |