Re: [Http-webtest-general] Count of failed/passed test cases
Brought to you by:
m_ilya,
richardanderson
From: Ilya M. <il...@ip...> - 2003-11-03 09:42:06
|
>>>>> "A" == archana <ar...@am...> writes: A> Hi, A> Is there a way i can get a buffer containing number of test cases passed A> and failed after running a perl script having multiple test cases? A> The results are formatted and being displayed properly. I need to have A> them in some var/buffer so that i can re-use info for testing. After running all tests you can get all results via Perl API: my $wt = HTTP::WebTest->new; $wt->run_wtscript('tests.wt'); print "Total number of failed tests: ", $wt->num_fail, "\n"; print "Total number of passed tests: ", $wt->num_succeed, "\n"; my @tests = @{$wt->tests}; for my $i (0 .. @tests - 1) { print "Test #$i: "; for my $result ($test->results) { print $result->ok ? 'pass' : 'fail'; } print "\n"; } see perldoc HTTP::WebTest::API, HTTP::WebTest::Test and HTTP::WebTest::TestResult. -- 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 |