Re: [Http-webtest-general] on_response question
Brought to you by:
m_ilya,
richardanderson
From: Ilya M. <il...@ip...> - 2003-04-01 10:36:12
|
>>>>> "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) = $webtest->current_response()->headers->{refresh}; RB> $SID =~ 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 |