Thursday, July 21, 2011

Driving a complex AJAX APP

An eValid user wrote:

Driving a complex AJAX APP...Tell Me How

This is a good question and it raises an interesting point about how modern web browser enabled applications that involve large amounts of AJAX actually operate.

If you recall, when AJAX is used there are JavaScript programs that run in the JavaScript engine (inside the browser) that do all kinds of things, but mainly control communication and data transfers between the browser and the server, based (in part) of user inputs. Think in terms of what you see on your screen when you type strings into a search engine that has implemented some kind of "autocomplete" feature. In that case there is a LOT of back-and-forth to/from the server.

The amount of processing time for that used to be very small, almost "invisible" to you as a tester in the scale of time that relates to your test cases.

But, as the total volume of JavaScript has grown the total time that running those (admittedly, wonderful programs) also grows. Accordingly, the amount of time it takes for the browser to settle down and reliably accept an input from the test engine grows.

That's where the problem arises.

eValid's structural commands are done separately from that JavaScript (this is an important architectural feature of eValid's implementation -- the non-interference with JavaScript). Even so, we have seen cases in which the eValid structural commands are "too fast" for the browser...we have heard of cases when, due to rapid-fire issuance of structural commands that update the DOM, the browser actually aborts execution!

So, what to do?

What we recommend is to insert a Delay 10 command, or perhaps a Delay 100 command after major structural command sequences to give the browser time to stabilize after the changes. For some cases, we have even had to use Delay 1000 -- that is, delay an entire second -- to prevent failure.

Or, duh, you could get a faster client computer (but you didn't want to hear that, did you!).

_____________________
eValid Tech Support

No comments: