Sunday, July 22, 2012

Getting My Bearings: Adventures in TestComplete Land

I had anticipated that there would be a few things I'd need to address to get to this in an effective way. I didn't think it was going to take me three weeks to get back here. Still, with a lot of the details of Test Coach Camp and CAST now completed, as well as taking a week out to go to Summer Camp (note, this is actual Scout Camp, not the SummerQAmp that you will likely be hearing a lot more about in the coming days), I think it's time to get back into the swing of things and visit with an old friend I really have not seen in a long time.

As I stated previously, coming back to TestComplete after what has been a few revisions (version 7 was the last one that I had actual interaction with, and most of my knowledge came from versions 5 and 6), I figured it would be like coming back to a familiar neighborhood a couple of decades after I'd been a regular. In some places, that's not so difficult (the Sunset District of San Francisco looks remarkably similar today as it did in 1990). Some neighborhoods, of course, will look very different (my home town of Danville, CA has changed greatly since 1990, so much so that there are whole neighborhoods there now that didn't even exist when I moved away). Where does TestComplete fall in this category? Surprisingly, a lot of the look and feel is very much the same.

This is primarily a Win32 application for Win32 applications. In the last few years, it has moved into the web space, so much of the infrastructure for this application is primarily of a Win32 flavor. While I would be really happy if I were to learn that TestComplete now supported Perl, Python or Ruby, alas, that is not to be, even in version 9. It does support VBScript, JScript, DelphiScript, C++Script and C#Script. These are languages that, admittedly, I'm not all that comfortable with, but they will work in a pinch and I can at least navigate them and make sense of what I see.
A quick example of a test script.

The system has a lot of flexibility and ability to integrate with and coordinate with Visual Studio, so if that is the primary environment that a tester wants to do their test development in, TestComplete is well suited to take advantage of this space.

What is also helpful is that TestComplete has enhanced and improved the Keyword testing apparatus and makes it a choice for recording and constructing tests. The benefit of Keyword tests is the fact that the tester can, with a little practice, construct tests using the keyword interface that will allow them to develop robust and effective examples that use such options as looping, branching, Data Driven Testing (DDT) and allow for modification of elements to work as standalone tests or as a suite of tests. If the user is so inclined, once they have cobbled together an effective set of tests, they can export the tests to one of the supported scripting languages.
A quick example of a Keyword test.
At first blush, the obvious approach will be to use the recording method. For people just getting started, this is a natural place to start, and several tests can be created in this manner. However, just as I would tell anyone using the Selenium IDE or any other tool, friends don't let friends use Record and Playback. Once you have built a number of keyword tests and have become familiar with the method for creating the building blocks for a keyword script, you may find that it is just as effective to build your scripts from scratch using the keyword tools, rather than recording and going in to modify the overly exact steps that are recorded.

A cool new tool that is new to version 9 is the Test Visualizer, that helps to show you, based on where in the script you are, what is happening. Rather than rely on the script and its description, the ability to see images that define exactly where you are in the script are available to the user. This is helpful when you are trying to look at recorded steps and debug/determine what you want to do as you plug in new script lines or keyword blocks.
The Test Visualizer with some sample SideReel screens

The biggest challenge with tools like TestComplete is that they start off gentle, they give some examples of what a tester can do, and then things get steep really quickly. The keyword interface helps, but even there, if you are a neophyte to the world of programming, you will struggle beyond the basics with TestComplete. The good news is that, even with that steepness, there is a lot of user documentation and screen casts to help the user make the move beyond the basics.

So as I stated at the beginning, this is a "get your bearings" level post. Over the coming days, I'm going to commit to a little bit each day rather than try to slam out big jumps. Also, I have some actual questions I want to answer, and I'm going to use my own site (sidereel.com) to try to answer them, or I might make some examples to go deeper if the options available don't carry over to SideReel. Stick with me over the next several days and see where this tour takes us. In many ways, your guess is a good as mine :).

1 comment:

Smita Mishra said...

Good Read...makes me want to look at TestComplete soon.