Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

petdance (2468)

petdance
  andy@petdance.com
http://www.perlbuzz.com/
AOL IM: petdance (Add Buddy, Send Message)
Yahoo! ID: petdance (Add User, Send Message)
Jabber: petdance@gmail.com

I'm Andy Lester, and I like to test stuff. I also write for the Perl Journal, and do tech edits on books. Sometimes I write code, too.

Journal of petdance (2468)

Wednesday October 31, 2007
01:13 PM

New WWW::Mechanize and Test::WWW::Mechanize spiffiness

[ #34802 ]
For those of you using Mech for your testing of your website:

    $agent->content_contains( qr/\QEnter keyword(s)/ )
        or $agent->dump_all( \*STDERR );

not ok 14 - Content contains '(?-xism:Enter\ keyword\(s\))'
#   Failed test 'Content contains '(?-xism:Enter\ keyword\(s\))''
#   at t/simple-search.t line 31.
#     searched: "<HTML>\x{0a}<HEAD>\x{0a}<TITLE>TitleTales&#153;</TITLE></HEA"...
#   can't find: "(?-xism:Enter\ keyword\(s\))"
/buttonsd/bisac2.gif
/graphics/bar.gif
POST http://hoops.flr.follett.com:2112/simpsearch.php [simsearch]
  clickval=                      (hidden readonly)
  searchwords=                   (text)
  S=<UNDEF>                      (checkbox) [*<UNDEF>/off|on/Include Out of Print / Please Order Direct Titles]
No longer do you have to do a $mech->save_content() and then run mech-dump on it. How has it taken me so long to put this stuff in there?
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Thanks Andy. A related (but slightly different) tool is WWW::Mechanize::Plugin::Display [cpan.org].
  • Do you think that will be the canonical use of dump_all?

    If so, would it make more sense for the default output stream to be STDERR rather than STDOUT, to save having to specify it every time?

  • ... when are you going to get red of whatever test server you are using for the test scripts that keeps failing and causing mech to be an unreliable dependency?

    I've started to migrate away from mechanize back to raw lwp in a few applications, simply becaus
    • I didn't know it was a problem until you mentioned it yesterday. I'm open to alternatives.
      --

      --
      xoa

      • In the past I think it failed most of the time on cygwin, due to the forking necessary for the server I believe, and I pretty much went back to LWP in spite of how nice mech seems (although mech can be an install festival).

        Maybe the first thing you could d
        • I can't test it on Cygwin. Regardless, my question still stands: What should I run my tests against instead?
          --

          --
          xoa

          • I think you could fix the problems with your testing if you used a cross-platform, CPAN-tested local httpd rather than the included LocalServer.pm . Maybe you could pick a CPAN httpd that passes tests on cygwin and ActiveState and Linux etc.

            NOT HTTP-Serve
            • Can you help out on this at all? Also, what's wrong with HTTP::Server::Simple?
              --

              --
              xoa

              • I can help out. I already put Net::HTTPServer on my cygwin and ActiveState Perl MSWin32.

                For starters, I can pick up a distribution using Net::HTTPServer for the back.t test, passing on your platform, from a url you supply and run the tests on cygwin and A
                • I'd be glad to have your help. The Mech code lives on Google Code. I'd also really like to be able to get rid of the cut 'n' paste in the t/ directory to support it all.

                  What can I do to help you?

                  --

                  --
                  xoa

                  • Did you get my emails to andy@petdance.com? I am mw487@yahoo.com. This is getting into the weeds.

                    In t/local/*.t, change:

                      delete @ENV{ qw( http_proxy HTTP_PROXY ) };

                    to

                    foreach my $proxy (grep {/http_proxy/i} keys %ENV ) {delete $ENV{$proxy}}

                    because