Re: [Http-webtest-general] RE: how to check required cookies
Brought to you by:
m_ilya,
richardanderson
From: Ilya M. <il...@ip...> - 2003-05-13 08:18:03
|
>>>>> "JW" == Jieming Wang <Jie...@en...> writes: JW> Another quesiton: JW> I have web server that generates customized headers: JW> MY_HEADER1=value1 JW> MY_HEADER2=value2 JW> ... Do you mean MY_HEADER1: value1 MY_HEADER2: value2 ? Your example doesn't look like a HTTP headers. JW> Is there any easy way to check if the headers are generated and returned ? There is no builtin support for header checks. You can use Perl code (untested) to test it using Hooks plugin: plugins = ( ::Hooks ) test_name = Header Checks url = .... on_response = { my $webtest = shift; my $response = $webtest->current_response; [ $response->header('MY_HEADER1') == 'value1' ? 'yes' : 'no', 'Have got correct MY_HEADER1 header', $response->header('MY_HEADER2') == 'value2' ? 'yes' : 'no', 'Have got correct MY_HEADER2 header' ]; } end_test Such checks should be probably supported in core. I'll consider implementing support for them in future versions. -- 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 |