Sunday, September 5, 2010

Web Application Test Automation Framework using webdriver/Watin Part1-Introduction

Designing a Test Automation Framework

In Today’s arena, with increasing number of people using internet applications most of the product companies are coming up with web based application to fulfill the need of large customer base of internet users.

The important aspect of any website development life cycle is how much testing efforts you are putting to make your websites more stable and error free. To achieve this you cannot really rely on only manual efforts. You must need a robust test automation framework in place which will make the life of manual testers easier by doing repetitive functional testing for each nightly build so that manual tester can give more time to exploratory testing and can find more hidden bugs from the system.

With most of the companies adopting agile development methodology, the companies have to put more efforts in manual testing to find out the bugs reported into system due to changes in requirements.

Before going into web based application development most of the people are sure and clear on how they are going to develop an application? Which technology they will be using? blah blah… but what about testing this application?? People are not clear most of the times on How to test this application unless they actually land into a testing phase. They rely on manual testing and suddenly with each sprint of an agile development they start realizing that there is huge burden on manual testers with each sprint as efforts of testing an already developed and newly developed functionality increases as sprint goes. And suddenly they start feeling that we need test automation so that regular functional test cases can be automated.

But the question is HOW???

Testers are really not sure about how to go about creating a test automation framework? What factors we should consider? Which tools should we use? Should we use open source or should go about the paid tools in the market? What will be the cost of the paid tools? Can we afford it?

All these questions come to our mind and till the time we figure out how to set up a test automation framework we realize that 2 more development sprints are completed and now we are having more stuff to test and cannot really find a time to think about going automated.

Sounds familiar!!!!!! Yes this is the situation in most of the companies working in web based application development (Don’t know how much of you are agree with it?). I personally faced all these problems in web based application development project when we used to do manual testing.

Now a days, most of the companies going for test automation of web based application with open source tools like selenium, Sahi etc in order to keep the cost of product development low as much as possible. But do really open source tool can achieve the level of test automation on which we can rely on like any other paid tool taking care of the test automation framework??????

The Answer is “YES”

There are some revolutionary tools available in the market which are not only open source (FREE) tools but also those are that much stable that you can really rely on them for designing a test automation framework.

I will list down some of the tools which are my personally favorite and I have used them to create nice test automation framework.

1. Webdriver: Also called as selenium 2.0 more information can be found on website for this tool

2. WATIN: Read as (whats –IN) . “Web Automation Testing In .NET “This tool is basically designed for web based development in .net

3. WATIJ : Same as WATIN for java development. “Web Automation Testing In .JAVA “

Today most popular tool that many of the companies are using is traditional selenium. No doubt the tools is powerful and supports many of the languages for designing and writing test scripts and also provide multiple browser support. Then whats the problem with it??

Limitation of traditional Selenium as I can see

1. Not much good html finding methods for web elements

2. Use of additional selenium rc server while executing the test scripts adds overhead

3. Xpath method for finding elements, fails in cases if there are any changes in the screen or by any reason and in turns fails the test script. It takes more time to fix these errors when your test scripts reaches the count of 1000+ than actually testing the application.

4. There is no surety that test script failed is due to bug in system . It can fail even selenium rc got any exception or if element is not properly visible to proxy and we are really not sure why it is failed in short less reliable.

I will not talk about the paid tool because the most important limitation for it is cost J

The tools that I have listed above have overcome all this limitations of traditional selenium and have really revolutionized the way of test automation.

First I will compare the these 3 tools so that you can see and check it if it satisfies your automation needs

Below is the table showing some of the comparing attributes for these tools. You can play with these tools and can see more features as needed by you to design your automation framework. Please note that I really don’t know that whether these tools can be used for flex based web application because I have not used it. So if you application is designed using flex then you need to ask this to online community on extending these tools for flex UI testing Or you might need to wait till the owners add APIs for testing web application in Flex.

Features\Tools ->

Web driver

WATIN

WATIJ

Multiple browser support( Firefox,chrome,IE etc)

Yes

IE only

IE only

Record and Play back available?

Not needed

Not needed

Not needed

Language support

.NET/JAVA/Other

.NET

JAVA

Pop up handling

Not good/Will be avialable in next release

YES

YES

Exception handling

Use language support to handle this

Use language support to handle this

Use language support to handle this

data reading/ writing facility

Use language support to handle this

Use language support to handle this

Use language support to handle this

Learning curve required?

should be aware of OOPS concept and language in which we are developing a script

should be aware of OOPS concept and language in which we are developing a script

should be aware of OOPS concept and language in which we are developing a script

Reliable

YES

YES

YES

Reporting tools

External tools can be used like MbUnit/TestNG

External tools can be used like MbUnit/TestNG

External tools can be used like MbUnit/TestNG

IDE

Visual studio/Eclipse

Visual studio

Eclipse

Above are some of the features of tools and more exciting is that tool owners are adding more and more features to it with each release and believe me these 3 tools are going to be king of automation testing because they are providing more and more features same as you would get in any paid test automation tool like QTP.

This is all about tools that you can use for web automation but it is only the first step in test automation designing. What we really need before we actually start working on test automation writing.

I will be writing more to this blog about test automation framework designing.

3 comments:

  1. Quite Interesting stuff man..
    nd nice to see dat although U r manual tester, u hav done good study on automation framework.
    I hv used only QTP & TestPartner (both Paid), so, i never used anyother tool, but one day, while searching "WATH" on google, i got watij in result,so, I hav little knwldge abt this tool :-)))))))))
    keep posted...
    -- Ashish Wath

    ReplyDelete
  2. @Ashish.. Thanks Ashish.. Yes its as good as any paid tool and more over you can exploit feature of language you are using for development.. all in all complete alignment with development cycle... And any developer will be able to help you if you are stuck because its in java or .NET.. :)

    ReplyDelete
  3. Good stuff man. First part of your post shows frustration where people at the helm ignore testing. I wish to abolish regular testers and just have engineers who develop and test both. The argument for separate test function is that people who build cannot be great critic. However, just like in cricket players bat and even field, same could be done here. Developers develop their stuff and critic somebody else's code!! May be world would have evolved in a different way then.

    I wouldn't consider WATIN to be free when you need to have C# compiler/debugger/libraries. In my opinion tool could be free if software on which it depends is free too and same holds true recursively.

    ReplyDelete