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:44
|
>>>>> "IM" == Ilya Martynov <il...@ip...> writes: >>>>> "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. IM> After running all tests you can get all results via Perl API: IM> my $wt = HTTP::WebTest->new; IM> $wt->run_wtscript('tests.wt'); IM> print "Total number of failed tests: ", $wt->num_fail, "\n"; IM> print "Total number of passed tests: ", $wt->num_succeed, "\n"; IM> my @tests = @{$wt->tests}; IM> for my $i (0 .. @tests - 1) { IM> print "Test #$i: "; Forgot line my $test = $tests[$i]; IM> for my $result ($test->results) { IM> print $result->ok ? 'pass' : 'fail'; IM> } IM> print "\n"; IM> } IM> see perldoc HTTP::WebTest::API, HTTP::WebTest::Test and IM> 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 |