>>>>> On Fri, 18 Oct 2002 12:10:33 -0600, Jag Pariti <jag...@io...> said:
JP> Hi. This seems like a silly topic, but I was wondering what syntax
JP> is necessary to define new functions within existing WebTest
JP> modules and how to call them properly from within tags such as
JP> "on_response" or "on_request". Any advice would be
JP> helpful. Thanks.
You can define them for example in on_start hook:
on_start = {
sub mysub {
# do something
}
}
test_name = Some Test
....
on_request {
# call previously defined sub
mysub();
}
end_test
I *think* it should work.
On the other hand it is very luckely that you *should not* do it. If
you find youself putting to much Perl code in wtscripts than it is
time to consider writting your own plugin this encapsulates all this
code.
You can find some docs on writting plugins in perldoc
HTTP::WebTest::Plugins. Though the best example is sources of
existing plugins.
--
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
|