Re: [Http-webtest-general] How to write webtest based testcases in perl
Brought to you by:
m_ilya,
richardanderson
From:
<joe...@us...> - 2003-10-30 20:22:32
|
archana wrote: >Thanks William, > >But what i am looking at is putting everything in perl script rather >than using 'wt' file. And i wanted info on how i can mention list of >global test parameters before any testcase? > > > archana, Sorry to say so, but RTFM aill reveal that you can pass the run_tests method two data structures, one consisting of global parameters and the other an array of hashes with test descriptions. Everything is nicely documented in the main documentation, and then there is the cookbook with nice examples. Try (on the command prompt): $ perldoc HTTP::WebTest SYNOPSIS use HTTP::WebTest; my $webtest = new HTTP::WebTest; # run test from file $webtest->run_wtscript('script.wt'); # or (to pass test parameters as method arguments) $webtest->run_tests($tests); [...] You want the second alternative. You can also read this online: http://search.cpan.org/~ilyam/HTTP-WebTest-2.04/lib/HTTP/WebTest.pm Special attention to section: Calling HTTP::WebTest from a Perl program (just click below): http://search.cpan.org/~ilyam/HTTP-WebTest-2.04/lib/HTTP/WebTest.pm#Calling_HTTP::WebTest_from_a_Perl_program There you have it, with examples and all... Good webtest scripting! Cheers, Joe. |