So back again for another round. While “away”, further hair was lost and failed to gain useful employment as a forester. Meanwhile, number 2 child on the way in December. Enough already.
Ran into TestGen4Web today; a Firefox extension (needs 1.5 beta) to help automate testing of web applications, developed by Spikesource, a company making a name for themselves by testing Open Source applications.
Aside from having a slick UML diagram, it adds a toolbar to Firefox to allow recording and playback of “clicks” you’re making as you surf. Once you’re finished recording, you can save the steps as an XML file (format specific to TestGen4Web), for a later re-run.
And re-running isn’t limited only to the Firefox extension. The second half of this project is a code generator which parses the saved XML and generates code for execution either against HTTPUnit (Java), Selenium (more Java) or SimpleTest (PHP). That means it’s easy to re-run the tests on a daily basis via cron, for example.
If you’re now puzzled, a while back Marcus wrote an introduction to SimpleTest’s “Web Testing” capabilities: Coding a Login Box Shouldn’t Hurt - “How Automated Web Tests Can Get Your Development Up To Speed”. More detail can be found in the documentation.
Looking over TestGen4Web’s XML format, it seems to be able to capture most things “GET” and “POST” related (e.g. clicking on links, filling in and submitting forms) as well as being able to test that the response to a request matches expectations, e.g. pull out the contents of a node with an XPath expression and check it matches values captured in “recording”.
Certainly useful to reduce the effort of writing SimpleTest web tests. At the same time I’ve looked at this kind of tool before, such as twill and maxq - have the opinion there’s only so much you can do if you’re not running the tests in a real web browser.
Have a “simple” situation I want to test which goes something like:
- User is shown a list of “items”
- User clicks on link and get’s a popup providing more info on a single “item” and form for making a “detailed selection”, the form containing significant client side Javascript
- On submitting the form, the popup closes and the original window updates to display the detailed selection
While it’s possible to test individual “units” of request and response happening here, with SimpleTest and similar, I don’t see a good way to test the popup or the Javascript contained in the popup - that means there isn’t really a good way to simulate the complete user “transaction” and test it’s working.
Potentially this is something TestGen4Web could solve, given it’s intimacy with the browser (see this question) but you lose the “translation” capability. That said HTTPUnit with help from Rhino, seems to have some support for this - haven’t tried HTTPUnit so no idea how well that works - given the fun we have with browser compatibility, I’m sceptical.
Somehow something based around wxMozilla or Internet Explorer / COM / Python seems more convincing - something that’s a real browser but still executable from the command line. Of course the downside of really solving this problem well is spammers will love it…
If you liked this blog, share the love:



October 31st, 2005 at 11:00 pm
Nice to see that Harry’s back in the house. :)
November 1st, 2005 at 3:41 am
What about to try something like this: http://wtr.rubyforge.org/ (only Win/IE).
November 1st, 2005 at 6:03 am
[…] Existuje jich mnoho, na hostingu s PHP lze využít např. SimpleTest. Dobrým úvodním článkem je Coding a Login Box Shouldn't Hurt, po jehož přečtení lze s automatizovaným testováním ihned začít. Podrobnější pohled na problematiku webového testování nabízí článek Website testing with TestGen4Web and Firefox, který mimo jiné upozorňuje na zajímavé rozšíření Firefoxu jménem TestGen4Web, které umí akce vyvolávané na stránce zaznamenávat do XML souboru a ten potom přehrát. Navíc podporuje externí nástroje jako např. zmiňovaný SimpleTest. […]
November 1st, 2005 at 6:53 am
Agreed. Good to see you blogging on Sitepoint again and congratulations on the forthcoming Harry (or Harriet!) Jnr :)
November 1st, 2005 at 7:49 am
Despite highly convincing arguments, the name Harry Jnr. has fallen on deaf ears…
November 1st, 2005 at 10:05 am
The forest’s loss is our gain!
Maybe Harrison?
November 1st, 2005 at 11:13 am
Wouldn’t worry too much about having no hair on your head… I’ve got next to no hair as well :eek:
I blame the genes I have, so it’s my parents fault - not mine :D
November 1st, 2005 at 12:11 pm
[…] Website testing with TestGen4Web and Firefox […]
November 1st, 2005 at 12:12 pm
[…] Website testing with TestGen4Web and Firefox […]
November 1st, 2005 at 8:46 pm
damn spammers :)
November 2nd, 2005 at 3:20 pm
Selenium was specifically coded to be able to test your simple situation as you stated above. It can test popup windows created by JavaScript in the browser. Download and run the self tests to see. Selenium can do this on most major browsers (IE, Firefox, Konq, Safari) on Linux, Windows, or Mac.
Also, you say “Selenium (more Java)”… at its core Selenium is just HTML and JavaScript that runs in your browser. There are drivers written in Java, Ruby, and Python that let you drive your browser from those languages.
November 2nd, 2005 at 4:27 pm
QA Podcast #7: Talking Selenium with Luke Closs
We’ve
been away, but we’re back! This week sees a change of pace here at QA Podcast,
with Wolfgang and Sophos’s
Luke Closs talking about Selenium,
a test tool for Web applications that runs in your browser.
Selenium is an open-source too…
July 16th, 2006 at 10:30 am
Thanks for the nice review!
I recommend that you have a look at “iMacros” from iOpus. It can automate (really) everything inside of Internet Explorer or the stand-alone iMacros Browser, even Flash or Java applets. URL is http://www.iopus.com/imacros/
We are using iMacros for more then two years now with excellent results.
September 6th, 2006 at 4:01 am
Gee, wonder if Paul works for iOpus. Test-drove that product but was unimpressed with dhtml support and IE6 or earlier requirement.
June 19th, 2007 at 5:14 pm
You can use WebAii to drive the browser here: http://www.artoftest.com.
April 24th, 2008 at 7:35 am
http://essentiabct.com is worth looking at.