Re: Automated Functional Testing

2009-07-10 Thread Kevin Teague

Yes, how many times have you followed the practice of:

 1. write some new code

 2. (re)start dev server and/or update dev database

 3. tab over to your browser and click away

 4. tab back to terminal to see the traceback when you hit an error

With a functional test suite, it becomes sooo much quicker to just do
a "./bin/test" and let a computer program do all that clicking work
for you, and you can get straight to the error messages and jump right
back into bug fixing.

However Canoo only allows you to script your test suites in either XML
or Groovy. If you want to write your tests in Python, then
zope.testbrowser behaves more-or-less the same as Canoo (automated
functional black-box browser testing) except you can write your tests
in Python. Although it's Python only, I haven't seen anyone develop a
Firefox recorder plug-in which would generate zope.testbrowser test
suites ... but then that tends to mostly be a hurdle only for new
users, after a bit of practice it becomes much more natural and
quicker to express browser actions directly from test code.

FWIW, zope.testbrowser is pretty quick too, I'm getting:

  Ran 49 tests with 3 failures and 9 errors in 1.340 seconds.

That doesn't account for set-up and teardown times (and I've got
failing tests because I haven't yet automated setup/teardown for the
functional test suite for the ldap server that app requires).

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Automated Functional Testing

2009-07-08 Thread Software Testing Training

Automated Functional Testing

By Bhrigu Malhotra ( http://www.qacampus.com )

First of all let me make you all aware that I’m a developer and what
you are going to read further is a developer’s account, so it may
sound to you like a layman tester. But what I’m going to share is
something which has been very helpful to me to ‘functionally’ test the
web application our team has been building and I thought this may help
you as well. So even if you are a tester, try to think the way
developer’s think for some time, I’m sure this would be useful to you
too.

Before I go ahead, I think we all understand that Functional Testing
is testing the functionality of our application which means you’d
probably be going through a login using some credentials, clicking
some links, verifying some outputs - in simplest terms. Now just give
it a thought that if you can automate these i.e. invest some time for
once and then while you are sipping a cup of coffee, someone is
testing what you coded. Change your code 10 times and run your test 10
times to ensure nothing breaks, so easy. Not just this if you have
continuous integration server setup which runs your tests, you’d come
to know immediately if and when someone else broke your code. Believe
me ones who have used it, feel it is fantastic.

There are a variety of tools available for this over internet each
with pros/cons but I’m going to share some info here about one which I
liked very much and have been using for a while now. I’d also share
why I preferred it over others.

Ok, no longer prolonging the suspense the tool I’m talking about is
called Canoo WebTest (webtest.canoo.com) which is a free Open Source
tool for automated testing of web applications in a very effective
way. The primary reason why I liked it is that it is FAST; very fast …
most of the test cases that I’ve written are executed in less than a
minute and that too over remote applications deployed on servers on
the other side of globe. Second reason for liking it so much is the
ease of writing; very quickly you can build up your tests. Though they
have released a WebTest recorder plug-in which when installed in
Mozilla Firefox can record the script for you, but believe me the more
you start writing there test cases, the less reliant you will become
on the recorder. Third thing is these tests do not use a browser so
that completely eliminated browser-specific issues which some tools
are plagued with.

Now some things about WebTest which some people don’t like is you
actually do not see the tests being executed i.e. loading of a browser
window, automatic clicking on buttons and errors on the screen (if
any). But that I feel that it is so by design …. Doing all this takes
time and then browser issues too creep in, so I’m happy like this way
only. I agree they can improve on reporting of errors but again the
objective of this tool is to test and just to test, if you want to
report issues manual intervention is needed.

At last I’ll just say go give it a try, I’m sure once past initial
hiccups, you’ll start liking it the way I am.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---