Friday, January 25, 2008
Using Selenium to test ASP.NET Ajax UpdatePanel postbacks
Recently one of my tests suddenly failed after adding ASP.NET AJAX UpdatePanels to the page. The problem turned out to be that after a Click, we normally issue a WaitForPageToLoad before continuing testing on the next page. This makes sure that the next page (after a postback) is fully loaded before we do the next test action. When using UpdatePanel postbacks, the page is never really submitted and no onLoad event ever happens in the browser. This makes WaitForPageToLoad time out.
Selenium is rather flexible and you can do a lot of custom tests in javascript, but you have to know how. It took me some time, but here it is: make Selenium wait until an UpdatePanel postback has finished:
Saturday, January 12, 2008
Searching, sorting, filtering... all client side with Exhibit
Sometimes you just run into a piece of technology that is so cool, that you wish you could make up a way to use it in a professional setting. Exhibit from the Simile project at MIT is such a technology. It brings a certain class of web application to the masses. Displaying data in compelling user interfaces that allow for searching, sorting, filtering, etc. used to be the domain of database backed web applications. Not anymore.
Exhibit is basically a very nice javascript library. It can be used to create pages on the client based on data files and templates (nicely separated from each other). The UI is created by coding up templates in HTML.
The sample
The sample I made: last summer, I went on a bicycling tour with my girlfriend visiting all prehistoric dolmens in the Netherlands. There are 53 of them and then a small number of fakes. At each dolmen we made picture and we logged the location with our GPS receiver. Back home, I created a data file (this is JSON formatted) of all dolmens and whipped up an Exhibit view page for the set. Compared with the time this took (of course I spent some time reading docs), the results are very impressive.
Noteworthy details
Other demos
On the Simile site, a load of other demos (some extremely nice, showing graphical plots of data) can be viewed. Go check them out and read the documentation and tutorials.

