Re: AJAX Testing

Stephen Cresswell <[email protected]> Mon, 4 May 2009 16:55:44 +0100
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <[email protected]>
Hi Frank,

I looked briefly at P2T a while back but didn't want to use a scripting
language to write the tests. We've used selenium on multiple projects for
the last four years, and while it does have several drawbacks (most notibly
speed and test maintenance), we've been able to work round them. Selenium's
killer feature for me is that it requires very little technical ability to
read the tests and if you're using the firefox plugin doesn't even look like
source code. This means that we can walk through the tests with our QA's and
customers, without turning them off with a java IDE environment or a
programming language. We've recently started incorporating jbehave and some
funky mods to the selenium code which allows us to write tests like...

<!-- Test login -->
open | the nuke data page
setup | a customer account with id 1AAA123 | fred
open | the login page
type | into the username text box | ${fred.username}
type | into the password text box | ${fred.password}
clickAndWait | the login button
assertLocation | */customer/1AAA123
assertTextPresent | Hello ${fred.firstName}

We've managed to get the build time down to an acceptable amount by farming
the tests out to multiple VMs.
For ajax testing we tend to use waitForXXX (although this does have the
drawback of waiting a number of seconds if the ajax request fails). We also
have a custom action waitForAjaxResponse which works with with prototype.js
We have used selenium to perform system monitoring - a small suite hooked
into the CI server, but no satisfactory solution for load testing as yet.
We're tried jmeter and httpunit and are currently exploring a DSL solution
in groovy / grails. If it looks like a dead end I'll give P2T another look.

Kind regards,

Steve

2009/5/3 Frank Cohen <[email protected]>

> Hi Steve:
>
> Selenium is good for record/playback of functional tests where
> playback is through a browser (Firefox, Chrome, etc.) The Selenium
> architecture works well for many tests but it does have its drawbacks.
> Selenium can be really slow at test play-back. Selenium uses a frames-
> based JavaScript plug-in architecture that does not handle browser
> originated events - such as dealing with modal Security dialog boxes.
> Selenium doesn't have a call-back architecture to make it easy for
> your tests to deal with Ajax-style asynchronous events. Lastly,
> Selenium does not have a solution for repurposing tests as load tests
> and business service monitors.
>
> PushToTest built a Selenium-HTMLUnit hybrid solution called
> SeleniumHTMLUnit. It reads Selenium tests in their native format and
> runs them using the HTMLUnit browser. The runner is data-enabled, so
> your Selenium tests use operational test data from CSV files, RDBMS
> databases, and other objects. And the runner operates the tests as
> functional tests, load and performance tests, and business service
> monitors without having to change the original Selenium test.
>
> SeleniumHTMLUnit is part of TestMaker, an open source test automation
> platform. A tutorial on how this work is at http://www.pushtotest.com.
> (The site is down this weekend for maintenance.)
>
> -Frank
>
>
>
>
>
> On May 1, 2009, at 5:20 AM, Stephen Cresswell wrote:
>
> > Any reason for not using an alternative tool like Selenium?
> www.openqa.org
> >
> > I use http for testing the headers are correct etc, but not for
> > checking javascript.
> >
> > Regards,
> >
> > Steve
> >
> > 2009/4/30 Shay Thompson <[email protected]>
> >
> > Hi, I’m trying to use HttpUnit to test an html page with ajax code
> > in it but I’m unable to create an XmlHttpRequest object of any
> > type.  Has anyone gotten this to work?  If so, could you provide a
> > snippet of your javascript and java?
> >
> >
> > FYI, I’ve tried this with HttpUnit 1.6 and 1.7 with no luck.
> >
> >
> > Thanks,
> >
> > Shay
> >
> >
> >
> ______________________________________________________________________________
> >
> > If you apply Ohms Law, e=mc2, to the hypotenuse and add to that a
> > catalyst consisting of a set of struts and a gigahertz, you will
> > theoretically arrive at an answer yesterday...
> >
> >
> > Shay Thompson - Lead Computer Scientist
> >
> > Adobe Systems, Inc. - LiveCycle Quality Leaders
> >
> > Voice: x34728 or 612.251.5415
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Register Now & Save for Velocity, the Web Performance & Operations
> > Conference from O'Reilly Media. Velocity features a full day of
> > expert-led, hands-on workshops and two days of sessions from industry
> > leaders in dedicated Performance & Operations tracks. Use code
> > vel09scf
> > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> > _______________________________________________
> > Httpunit-develop mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/httpunit-develop
> >
> >
> >
> ------------------------------------------------------------------------------
> > Register Now & Save for Velocity, the Web Performance & Operations
> > Conference from O'Reilly Media. Velocity features a full day of
> > expert-led, hands-on workshops and two days of sessions from industry
> > leaders in dedicated Performance & Operations tracks. Use code
> > vel09scf
> > and Save an extra 15% before 5/3.
> http://p.sf.net/sfu/velocityconf_______________________________________________
> > Httpunit-develop mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/httpunit-develop
>
>
>
> --
> Frank Cohen, http://www.PushToTest.com, phone 408 871 0122
> PushToTest, the open-source test automation company
>
>
>
>
>
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> Httpunit-develop mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/httpunit-develop
>

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com

_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop