Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Testing for websites?

by Cody Fendant (Pilgrim)
on Sep 17, 2012 at 03:30 UTC ( #993949=perlquestion: print w/ replies, xml ) Need Help??
Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:

I appreciate the Perl culture of testing. But how do you do tests when your code runs a website?

I can't test every page of a website after I make a change to the underlying code, and anyway the code is complex, there are ads being served, some of the page is random, for variety, and the HTML guy might be working on the template at the same time.

Do people make special tests which return simpler values than whole pages? Or does website testing always require human QA testers clicking through pages in a browser?

Comment on Testing for websites?
Re: Testing for websites?
by McDarren (Abbot) on Sep 17, 2012 at 03:37 UTC
    Hi,

    I've not used it myself, but I suspect that WWW::Selenium might be what you are after.

    HTH,
    Darren

Re: Testing for websites?
by rjt (Deacon) on Sep 17, 2012 at 03:40 UTC

    You might want to have a look at WWW::Mechanize. It can definitely handle the heavy lifting of the testing automation.

    You will probably also benefit from unit testing the lower layers of your application. Do all of your library functions have unit tests that (reasonably) cover all kinds of inputs, good or bad? Test::More is your friend, here. You can also play with Test::Simple if you're new to the Perl testing style.

    You will still of course need some human QA (write a test plan for your testers that covers your requirements), but the automation can certainly help you catch coding errors more quickly.

Reaped: Re: Testing for websites?
by NodeReaper (Curate) on Sep 17, 2012 at 03:46 UTC
Re: Testing for websites?
by chromatic (Archbishop) on Sep 17, 2012 at 03:47 UTC
    But how do you do tests when your code runs a website?

    I know what output I expect, and I test for that.

    (See Simplified HTML Testing with Mojo::DOM and Mech for an example.)

    I can't test every page of a website after I make a change to the underlying code....

    If you have code to generate every page, you can test every page.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://993949]
Approved by McDarren
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (16)
As of 2014-07-10 17:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (213 votes), past polls