Today we are fortuitous to hit a temporary place by Apostle Lightbody, most fresh of BrowserMob honour (and previously Selenium work, OpenQA, WebWork, and more). Let’s center in to him speech to us most alluviation testing, and permit him undergo your thoughts in the comments below:
I’ve been nonindustrial and investigating Byzantine scheme apps for a daylong time. I was the co-creator of WebWork (now Struts 2.0) and an primeval endorse of DWR, composition digit of the prototypal AJAX modify determination frameworks for Java scheme apps. But over the years, I detected that as our scheme technologies and techniques got more sophisticated, our investigating techniques were not ownership up.
That was ground I supported OpenQA and helped acquire Selenium to the favourite investigating agency that it is today. Selenium helps with functional testing of Byzantine AJAX apps, but there isn’t an equal for alluviation testing, which is ground I started BrowserMob, a newborn identify of alluviation investigating service.
Traditional alluviation testing
In visit to attain broad levels of concurrency, tralatitious alluviation investigating tools (both unstoppered maker and commercial) impact by sending caretaker drawing of protocol requests as a artefact to feign whatever concurrent users interacting with your scheme page. These tools impact by transcription the reciprocation that comes from a covering conference and then requiring that the alluviation inquirer draw a generated playscript so that it worked correct when played backwards X nowadays concurrently.
Common problems would be that the initial transcription would embed in cake values that were equal to individualist sessions. Additional unequalled land strength be encoded in another unseeable modify elements, every of which required whatever dustlike tuning after the fact. If you’ve ever proven to separate a alluviation test, this is belike a rattling old process. It has worked fairly substantially up until past years, but AJAX has prefabricated this impact modify more difficult.
Ajax + alluviation investigating = hard
The think Ajax has complicated things is that it encourages more system and land to separate exclusive the covering session. This effectuation that meet watching the reciprocation crossways the accommodate doesn’t needs verify the flooded story. The richer an app gets, the more arduous it gets to feign the literal personalty of hundreds or thousands of users touch your site.
This is the difficulty I definite to cipher when I started BrowserMob. It’s on-demand, low-cost and uses real browsers to completely modify the artefact alluviation investigating is recorded and played back.
Do actual browsers rattling matter?
Real browsers dead matter. There are digit field reasons:
- It simplifies the playscript creation impact by letting you refrain every the complexities and hacks you hit to do with tralatitious alluviation investigating tools.
- It ensures that you’ll wager 100% of the reciprocation and alluviation against your place that a actual individual would cause.
We’ll countenance in-depth at apiece of these topics severally to wager how ingest of actual browsers helps and how a assist aforementioned BrowserMob compares to existing alluviation investigating technologies.
Simplifies playscript creation
In today’s recent scheme applications, AJAX is meet most everywhere. And we’re not needs conversation most caretaker flush applications aforementioned Google Maps or case Mail, but modify ultimate sites aforementioned google.com today ingest modern AJAX techniques. See Google’s auto-complete for a real-world example:

In this case, when typewriting values in to the wager box, the scheme covering executes JavaScript system that in invoke makes AJAX calls to Google’s wager engine, asking for wager suggestions to display. It does this on every keystroke that the individual types in. This is a accepted auto-complete curb that most Ajaxian readers are rattling old with.
When transcription a playscript with a tralatitious alluviation investigating tool, digit of digit things haw hap here:
- The functionary module wager the AJAX reciprocation and getting it for playback in the alluviation test
- The achievement module not wager the AJAX reciprocation and module exclusive getting the letter prefabricated when the individual clicks the “submit” button
Obviously these Ajax requests are feat actual load, so we poverty to attain trusty they intend played backwards in a alluviation test. Let’s adopt you’re using a tool, such as JMeter, that does getting the AJAX traffic. Here’s what that looks like:

The transcribed reciprocation is effectively:
http://clients1.google.com/complete/search?hl=en&gl=us&q=b
http://clients1.google.com/complete/search?hl=en&gl=us&q=ba
http://clients1.google.com/complete/search?hl=en&gl=us&q=ban
http://clients1.google.com/complete/search?hl=en&gl=us&q=bana
http://clients1.google.com/complete/search?hl=en&gl=us&q=banan
http://clients1.google.com/complete/search?hl=en&gl=us&q=banana
Each key attack by the individual is included in apiece ensuant wager term. Let’s cut the responsibility of validating the results that become backwards from the AJAX requests for the instance (they are commonly in JSON or XML info and arduous to reassert using most tools). Instead, let’s meet add a sophisticate to the alluviation effort responsibility for doing searches: the alluviation effort staleness wager from 100 assorted wager terms.
Parameterization is rattling ordinary requirement, since it ensures that the alluviation is graphic and doesn’t intend cached in whatever eery way. This effectuation that today in constituent to intelligent for the constituent “banana”, we’re also intelligent for “apple”, and “orange”, among others.
However, this effectuation your playscript can’t meet blindly accede requests to those preceding URLs either, since those were equal to the “banana” term. Instead, they staleness wager for the sequential characters of the individual wager term, such as:
http://clients1.google.com/complete/search?hl=en&gl=us&q=a
http://clients1.google.com/complete/search?hl=en&gl=us&q=ap
http://clients1.google.com/complete/search?hl=en&gl=us&q=app
http://clients1.google.com/complete/search?hl=en&gl=us&q=appl
http://clients1.google.com/complete/search?hl=en&gl=us&q=apple
Unfortunately, this is where modify the prizewinning tralatitious alluviation investigating tools start down. They don’t wage whatever support here, so it’s up to you to amount discover how to, if it’s modify possible, indite Byzantine scripting system that breaks downbound the arbitrarily designated wager constituent by characters and then afterward supply Ajax requests for apiece case in the term.
At this point, you’re essentially redaction the aforementioned system that the scheme app developer wrote originally. If you’re a QA engineer, this haw be arduous since you don’t undergo every the interior AJAX system coded in to the application. If you’re the developer, it’s ease galling because it’s windy and probable in a module another than the warning JavaScript that you wrote your cipher in.
So how do actual browsers help?
Because BrowserMob uses actual browsers to both achievement and playback load, that effectuation you don’t hit to vexation most disagreeable to feign the system in a scheme browser. Instead, every you hit to do is achievement the manlike interaction with the browser, such as typewriting in a arbitrarily designated wager term. BrowserMob module then transfer those manual on to the hundreds or thousands of browsers involved in the alluviation test, and those browsers module in invoke “do the correct thing” and supply the comely AJAX requests.
And if the inexplicit logic, such as the letter address ornament for those AJAX requests, changes? With tralatitious alluviation investigating it’s up to you to notice and mend the problem. If your effort uses actual browsers to endeavor backwards the traffic, your playscript won’t requirement to modify digit taste - the newborn AJAX system module be separate by the covering in actual time.
Ensuring graphic playback
We’ve seen how ingest of actual browsers helps with playscript creation, but what most playback? As we meet learned, using actual browsers simplifies the impact of transcription and shrinks the activity coded in to the playscript itself. This effectuation we’re letting the actual covering - the aforementioned identify of information your modify users module ingest - attain the decisions most what requests to make.
For example, when temporary http://ebay.com you strength wager the mass page:

But charge the tender and today you strength wager this:

Notice a difference? The bunk correct country has completely assorted images displayed. That’s because eBay’s bag tender chooses what to transfer supported on Byzantine and multi-variant system observed at runtime. It’s quite probable that it’s feat to be impracticable for a alluviation inquirer to undergo which images module be displayed on whatever presented request.
It’s genuine that whatever alluviation investigating tools module essay to parse the pages in actual instance and amount discover which images should be displayed, but that’s scarce satisfactory erst you’ve already scholarly they can’t care with modify the most exclusive Ajax components, as we meet saw. And as most AJAX developers know, resources such as images and stylesheets are more and more probable to become from Byzantine JavaScript system and not cod to a ultimate noise meaning in an HTML page.
Instead, the exclusive artefact to indorse that every azygos goal (image, JavaScript, AJAX request, advertizing from an ad partner, etc) gets requested is to ingest a actual scheme covering during playback. While it is such more inventiveness intensive, it is also a field instance saver on both the front-end, as scripts are such simpler to write, and the back-end, as you crapper be overconfident that the most graphic take of alluviation was produced.
So incoming instance you center of alluviation investigating event on digit of your Ajax apps, attain trusty those doing the investigating see the complexities and difficulties related with investigating a Byzantine scheme app. Help them be on the construction for the issues highlighted here.
Thanks to Apostle for composition this. Do you hit something essential to say? If so, contact us with your idea!




