SelPerl has asked for the wisdom of the Perl Monks concerning the following question:

Hello PerlMonks! I'm currently using Selenium RC and Perl for automated testing. However, it seems that the generated report of Test::Harness is very limited. It only prints what tests scripts and what specific tests failed. I want to know what specific configuration (browser, host, etc) in a specific test failed. Does anyone know how to do this? I've been to the official forums of Selenium RC but they suggested asking this question here. Thank you very much.

Replies are listed 'Best First'.
Re: Selenium RC and Perl
by ikegami (Patriarch) on Apr 27, 2010 at 03:38 UTC

    It only prints what tests scripts and what specific tests failed.

    I don't know what you mean. It prints what you tell it to print.

    use strict; use warnings; use Test::More tests => 1; is(1, 2, "foo") or diag("bar");
    a.t .. 1/1 # Failed test 'foo' # at a.t line 6. # got: '1' # expected: '2' # bar # Looks like you failed 1 test of 1. a.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests Test Summary Report ------------------- a.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=1, Tests=1, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.01 cusr + 0.00 csys = 0.03 CPU) Result: FAIL Failed 1/1 test programs. 1/1 subtests failed.
      Sorry if that was vague. The situation is that I am running two subtests in parallel, each having different configurations (host, browser, etc). They run at the same time so their outputs were mixed in the console. Now I want the summary report to be detailed so that I would know which particular configuration failed. Thanks.

        Maybe you can have each test script write its output to its own log file, avoiding the interleaving of outputs on the console. Maybe you can do something like what is suggested in Redirect output of Test::More/Simple.

        update: For Test::Harness, see execute_tests in Test::Harness.

        I don't know if that's possible. Sounds to me the real problem is that you're mixing the outputs.