Friday, April 18, 2008

JQuery - Web 2.0 framework

Jquery opens up a new way of thinking in javascript programming. It is something really an abstraction in implementing old javascript ideas. Definitely, it is worth trying if you want to develop components for Web 2.0 based application.

When you try to implement some new rich user functionalities with rudimentary, it is time consuming and error-prone. Imagine that if you want to write a effects such as fading out a html element using ordinary javascript, it will take time and you should be little expert to do that. I mean you require some experience.Initially; you need to understand how dhtml is going to work Not only it is difficult for novice programmers; it is time consuming when we debug it. So this framework comes to rescue any experienced as well as novice javascript programmers to think in JQuery way. Initially it is bit intimidating to understand what this stuff is, but gradually it is really useful to useful in adapting this framwork.OK.Enough with the story

So anybody has thought that the Javascript is really stupid, and then it is right time to change that notion. Let us look into some of its concepts.

Jquery supports objected-oriented programming. And also, it supports Chaining. Chaining means, we can place successive actions or method invocations (for example) in a single call. So you do not have to make nested method calls to arrive the final result. But how do you make such a call. Let us say you need to add fade or hide a &l;div> element in an html document. So you can do it by

$("div").fadeOut() ;

Or

$("#idvalueofdivtag").fadeOut();

where as "div" is an HTML element type or #idvalueofdivtag is name of <div> tag's ID name present in the document. With the above execution contents between that <div> tags will be faded out. Of course, you need to decide what event will be fired to make the above call in order to achieve the result. It is pretty simple, right.

If you get a time, then please have a look at this web site, http://jquery.com/. If you see this web site at least once, it has got once nice demo of this framework on the opening page itself. Feel the experience. It is really superb.

Already there are two books written on this amazing framework. Two chapters are free to download from ‘Jquery in action’, published by Manning Publications. It has provided nice tutorial also on the site which you are required to go through it. It is really worth reading.

This framework never stops you using other frameworks. If you really need another javascript source to be used along with this, then Jquery has provided an alternative.
jQuery.noConflict(). This method call will create an alias to Jquery object itself and can prefix to the normal method routines.That way the conflicts can be eliminated.

Also, you can see numerous plug-INS have already been developed to enhance rich user experience.
Personally I felt this one more better performing than other web2.0 frameworks developed in JavaScript. Google also started using this framework!.

Sunday, March 09, 2008

Sahi - Open Source Web Testing Tool

Any body who has been working in testing applications know what is WinRunner and LoadRunner.

A commercial testing framework developed by Mercury Software.This tool provides testing script to an existing application and also a tester can master this scripts to test the applications.It happens this way.Tester starts testing each and every links or button in a web application and a in-built facility has been provided in the same to play back these scripts.Once the testing is over ,the tester play back the saved test script file.

Similarly , there is an open source testing framework developed in java called 'SAHI'.This frame works similar way that was explained above.Since it is developed 100% in java, customization to this framework is really easy depending upon the requirement.You can download this framework from http://sourceforge.net/projects/sahi/. There is a document included in this pack how to install and run it.

But this framework does not provide any in-built commands to enhance the testing, but merely a mediocre testing tool that can be used to test the web application.

Once you downloaded this framework, copy to a folder in your hard disk.Copy to C:\sahi. If you further explore this folder you can see a bin folder with a batch file to execute the sahi server.When you double click on this batch file, sahi server will start.This server will be listening to port 9999.

After this point you need to make few changes in your favourite browser which is self explanatory and enter any url.Alt + DBlClick will open script window where in you can start recording the events.It will record every click user making on website.Once you feel that the recording is enough then you can stop it and playback the scripts.

However there are certain discrepancies have been pointed out.Like, if you open more than one links, then this framework will register only one link.As far as security is concerned, there is one thing caught into my observation that it is decrypting password value automatically and was able to see the password entered!.

This is a very small framework which can be considered as a model testing framework.But a good deal of work is required to make this framework to use in day-to-day testing applications.
ThoughtWorks , US based company has extensively worked on this open source product.