follow me icons

Saturday, December 18, 2010

QTP VS Selenium Webdriver and Cucumber

My company was using QTP to do the test automation for the past 3-4 years. But we are now moving to cucumber and selenium Webdriver. This blog is about why we are moving away from QTP in my company.

One of the main reason that we move from QTP is that it is a reactive approach of writing test automation. The product is finished and the tester starts writing the automation test. Only the tester writes the automation. With cucumber and selenium , writing automation test is a joint effort between the developers and the testers. The testers write the test cases in cucumber scenario format, then the developers write the steps definition. This way, everyone is contributing and everyone is reviewing the test cases.

In our case, our QTP automation tester left the company and the QTP vbs code is hard to maintain and to read compared to cucumber and ruby code. I have tried to read QTP code to try to convert the test to cucumber and it is just taking quite a lot of time to just understand what the scripts do. With cucumber, selenium webdriver reading what the tests do only take 1-2 minutes as cucumber scenarios describe the behaviour of the system. With cucumber and selenium, everyone is contributing to the automation code and therefore knowledge is being transferred all the time.


QTP is very costly while cucumber, selenium webdriver is free.

Is there any version control in QTP? In our case, we put the automation test code (cucumber, selenium webdriver) as part of the system source code so the automation code is sourced controled.

We can develop the automation code in Windows, Ubuntu, Mac or in any other platforms that you like. This is another topic, but in our case everyone is moving away from windows as well especially the developers which is why QTP is abit useless as you can use Windows only.

Continous Integration is also an ease. We use hudson to automatically run the automation test whenever there is a new build so the developers can get an instant feedback of their changes.

Selenium webdriver can do alot more tests than the previous version (selenium rc) including java script requests and ajax test.

Getting a support answer is very fast in the open source community. Also, you have access to the source code. Since it is a joint effort to write the automation test, we are able to solve alot of issues together.

Other IT departments in our company are already ditching QTP in favor of cucumber and selenium and we never want to go back to QTP after this.

I believe QTP have other benefits as well that I do not know. However, in our case using cucumber and selenium webdriver is more relevant and better than using QTP.

4 comments:

  1. Hi Bananta,

    Though i am a QTP fan, I like your post for some of the reasons you have stated especially Continous Integration.
    Would like to make this post a candidate on my blog which has the best articles and posts across the web.

    Do mail me at aditya_kalra@ymail.com and let me know if it is fine i add this to my blog.

    My blog: http://go-gaga-over-testing.blogspot.com/

    Best Regards,
    Aditya Kalra

    ReplyDelete
  2. Hi Bagas,
    Great to read your posts... Just wanted to let you know your post has been very popular on my blog! Thnx and continue the great work..

    Best Regards,
    Aditya Kalra.

    ReplyDelete
  3. Hi
    we are currently starting with Cucumber, and what I found a bit scary is that without a UI you don't see whether your Cucumber tests are actually testing the right thing. Several times already the Cucumber test was green, but when I then ran the test manually it should have failed. The Ruby code was just not testing the right thing.
    A tester here that showed me how QTP tests were done before I started, and I liked the way it displays what's going on, so you can visually inspect whether the test is going to plan. What is your thought on that?

    ReplyDelete
  4. Hi,

    With selenium webdriver, you will run the test with the browser open so you will see what the test is actually doing. If you are using Watir then you will run the test in the headless mode but if you use capybara or selenium webdriver then you run your test with the browser/UI.

    The cucumber test that I create always run with the browser/ui. As of now, my company has ditched QTP completely in favor of cucumber because of the advantages that I mentioned here.

    In my opinion, Ruby script is vastly better than the QTP vb script and definitely alot more readable. After using cucumber, I would never want to go back in using QTP.

    If you want to setup cucumber with UI, please have a look at my post here http://qastuffs.blogspot.com/p/steps-by-steps-guide-to-setup-cucumber.html

    ReplyDelete