Why your synchronization method doesn’t work anymore

In the good old days of Web 1.0, you clicked something and you got a new page. And so your script could pause until the page finished loading. AJAX made things slightly more trick, but checking for the presence and status of elements on the page solved a number of these problems though. And when that doesn’t work you can use a ‘latch'[1]. But now we have Comet to worry about too.

I didn’t even know that there was such a thing as Comet until hearing an IT Conversations podcast with Greg Wilkins on Cometd and Push Technology. The big technique in Comet is Long Polling — which is apparently not new, but just seems to be catching on in the greater realm.

The problem with Long Polling is that it absolutely breaks page loading as the page never ‘finishes’ loading. And it is going to break even simplistic latches as the open poll will close the latch even though things are complete on the page. And at any point the latch could be opened and change the content of the page that you just verified was correct. Maybe keeping it correct, but maybe not.

Fantastic, eh?

The latch problem is solvable by having fine grained latches, but the once-was-verified-but-now-is-not problem I have no idea how to deal with.

And while on the subject of Coment apps, there is something else that as a tester you need to keep track of, and that is the number of socket connections on the server. Especially if using something like WebSockets which don’t limit connections to the server. The bottleneck to watch for has moved yet again.

[1] Modify your AJAX calls to set something on the browser window object that is updated upon completion of the call.

Comments 1

  1. nick wrote:


    Can you comment any possible work arounds for testing a long polling website, where the page never finishes loading, say using selenium-webdriver, which has is page-load blocking?

    Thanks in advance,

    Posted 20 Apr 2011 at 12:43 pm

Post a Comment

Your email is never published nor shared. Required fields are marked *