Adieu to QTP. Now for a closer look at Selenium

To borrow from Groucho Marx – QTP, I’ve had a wonderful time, but  this wasn’t it.

So thankfully I’ve been able to step away from QTP for the moment. Given that QTP doesn’t recognise Firefox so well after v3.6, and since we use a firefox plugin for most of our mobile testing (FireMobileSimulator), yours truly gets to switch to Selenium instead. I’m thankful for having had the opportunity to work on QTP, mostly so I have a better understanding of its limitations and shortcomings. I can argue more coherently against what seems to be in most cases, a ridiculous waste of money.

I view QTP a bit like one of those unfortunate bears in a Chinese bile farm. You can see how at birth it had the potential to be something majestic and powerful, but instead it languishes in a cage, irreparably twisted and deformed by years of abuse by the ignorant.

In comparison, Selenium while not without challenges of its own, has been by and large a real joy to use. For starters, having any number of fully fledged languages to work in is almost unbelievable after having toiled in VBScript land for far too long. In fact, the first problem I faced was which language do I go with?

I ended up choosing Java and JUnit, mostly because it’s what the current dev team codes with, and I simply cannot be arsed copping the flak I would get from management for introducing another language into the picture (as wonderful as jruby and jython are, I’m sure).

I didn’t realise quite how much thinking in VBS had stunted my thinking in other languages. I do a bit of coding in my spare time, but as far as automation coding goes, it took me a good few days to get comfortable again remembering the power that a real language gives you. I was all set to start importing test data from excel when a timely tweet (and subsequent blog post) from Adam Goucher reminded me that Java has these nifty things called Properties that you can import. (This is why tools like twitter should be allowed in the workplace btw – okay my RSS reader would have picked it up, but not before I’d wasted a lot of time).

It’s been a bit over 3 years since I last looked at Selenium. It doesn’t ‘feel’ all that different, but it does seem a lot easier to work with than I remember it being. Within a couple of days I’d whipped together a script to cut down some checks that took 4 hours manually to a little under 2 minutes. W00t.

I added loggingSelenium to my test setup and now have some pretty colours that light up for people who are impressed by that sort of thing. I’m now in the process of putting together a few more tests and a framework that will support them and their inevitable expansion.

There are a bunch of setup how-to’s out there, so I won’t be doing that, but I will drag together some of the more useful links that I’ve found. Stay tuned 🙂

7 thoughts on “Adieu to QTP. Now for a closer look at Selenium

  1. Hi Ben, I hear the same thing from many folks, any chance of a follow-up post on the shortcomings or stuff that you didn’t like other than VB? Trying to convince some people where I work that starting an automation initiative with QTP will end up with tool-buying remorse…

  2. Hi Jason,
    Yeah, I can probably whip something up.
    For the moment though, here are some of my irritations:

    You can only have 1 test open at any one time
    You can have as many function libraries open as you like, but QTP’s horrid excuse for an IDE sometimes loses its way if you want to step through a test.
    You can’t use any of the in-built validation functionality in functional libs either, for no good point that I can see.
    I’ve had all sorts of trouble getting an auto-documentation generator to work on QTP library files. Forget about anything in an ‘action’ – they’re stored in binary.
    Actions look like a great idea but when sharing them, they seem to lose their mapping really easily.
    I could go on, but that should be enough to at least raise concerns.

  3. Hi Ben,
    I’m sure you’ll never regret on the decision of using a real OO programming language like Java in your test automation.
    With so much of resources available for Java, solutions for general programming problems are only a google search away.
    I’ve read in one of your earlier posts you’re using Michael Hunter’ LFM approach. I’ve used a similar approach and outstanding results in my automation efforts. I’ve blogged about it here. http://elusivebug.blogspot.com/2009/05/test-automation-approach-object.html . Unfortunately I came to know about LFM after I’d been way too far into my implementation. However I’m in the process of implementing the de-linking of verification and execution code as suggested by Michael.
    The power of a junit framewok and OO language is way too powerful than a language like VBScript.
    Love to hear about your selenium experience and keep blogging.

  4. Hi, I have in mind your place weight be having browser compatibility issues. When I look at your website in Safari, it looks famous but when vernissage in Internet Explorer, it has some overlapping. I proper wanted to force out you a knee-jerk heads up! Other then that, far-out blog!

Leave a Reply

Your email address will not be published. Required fields are marked *