Thursday, March 26, 2009

An AGILE approach towards testing using Mercury's QTP

I have been in many different projects each following a somewhat different software development methodology. There are many core methodologies out there, common ones being Agile,Extreme Programming,Waterfall etc.. However, since i am a huge advocate of agile methodology, I recommend that quality/functionality testing should also be done in an agile manner.

Now there are unit tests which are written before each piece of code. However, once the developer is done with his/her part, it is passed on to the QA team. There are some who claim that QA can not perform testing following an agile approach. But i believe it is definately possible and proves to have a better result. Here is my take on how QA can follow an agile approach. The testing tool to be used for automation purposes is mercury's QTP.

The basic requirement is that development team delievers regular builds and there needs to be some co-ordination between the QA team and the development team.

Now automation scripts can be developed for each individual screen for a web-based application. Even if a page is not ready, one can acquire a .jsp or asp file from the developer which should contain all the required ids, elements and their names.

Once this is achieved, the tester can write scripts using VBScript and desciptrive language for that page according to required functionality.

Hence, as soon as the development of a page is done and goes into the build, it can be tested right there and then. This really saves time for testing as all the pages are tested hand and hand and then there is no requirement to have 2-3 months dedicated specifically towards testing time.

Monday, March 2, 2009

Mercury QTP.. automated testing tool.. List of "Do-nots"

Recently I have had the privilege of working on Mercury's product called Quick Test Professional. I found it to be very powerful in terms of use and operation. It can be used to automate user actions in two ways:
  1. Recording
  2. By Scripting.

1. Recording
It is fairly simple and all one has to do is press Record button and then perform actions as a user would normally. These actions are stored and then can be played back again & again for regression purposes. It uses an object repository to store different properties of elements on the page. e.g. a drop-down list with properties such as name, list values, x and y co-ordinate etc are all store in the repository.
Based on this, it becomes easier for QTP to recognize a specific element and perform functionality accordingly.

2. Scripting
This is the method that I used the most. The language used is VBScript. If you have some hands on experience with VBScript you can really use it to your advantage. The VBScript in combination with scripting language handles many functionalities mimicking end user.
The method certainly has some dis-advantages attached to it. It you are purely using Scripting for testing purposes, you will have to handle a lot of properties for an element. Here are a few reasons for why I am saying this
  • Lets say there is a drop-down list which has a name: list1 and id: weblist1. Now if these two tags remain the same you are good to go, otherwise, if they are removed or changed, your script will break or shoot an error.
  • Secondly, if the page is not coded in a good fashion, many of your elements may end up having the same tags. On this QTP shoots an error of "many elements with same id. unable to identify"
  • Thirdly if you resort to using Index values, which I highly discourage. At any point in time, the screen layout may change and the element that your indexing, its index will either increase or decreasee. Hence you will loose reference of your element.
  • If you do not have your elements defined properly, it may cause QTP to halt your machine for a minute or two especially if you are on a report page which has a list of elements which are read-only and do not have well defined ids.



Sunday, March 1, 2009

TinyUrl.Com.. making it small and palatable

Tiny URL has a lot of advantages. It can really save people the hassle of remembering those big long URLs.

The use of Tiny URL is really easy. One can simply navigate to the site www.tinyurl.com and plug in a URL which needs to be reduced.

e.g. a URL. http://www.google.com/search/new/window/name:=hasaangilani
can become
http://tinyurl.com/hasaangilani