Hello,
=20
There are several examples in the documentation for using on_response in =
a
wtscript file, but I couldn't find one for a perl script. =20
=20
I have a function called 'get_doc_ids' that I want to call. I tried =
setting
it up as follows, but I got errors:
=20
my @jobs;
my $webtest =3D new HTTP::WebTest;
$webtest->run_tests( [=20
{
=20
test_name =3D> 'translate html document from the internet',
terse =3D> $terse,
url =3D> $base_url,
method =3D> 'post',
params =3D> ['form', 'do_add_doc',
'lang_pair', $lang_pair_string_short,
'encoding', 'Latin1',
'quality', '7',
'priority', '1',
'translit', 'on',
'type', 'url',
'url', $trans_job1],
# Problem happens on the line below =20
on_response =3D> { @jobs =3D =
get_doc_ids($webtest->current_response->content);
},
text_require =3D> [$trans_job1 ]
=20
}=20
] );
=20
Can anyone tell me the correct syntax to use for 'on_response' in a perl
script (as opposed to a wtscript file). Thanks very much (in advance).
=20
- David
=20
|