That podcast played while I planned and constructed this site and I realized that:
- I enjoy writing
- I enjoy coding
- I know how to write test automation
With this in mind, I thought I should start sharing what I know about writing up test automation and how to get started with it. The world of software test automation is immense and overwhelming to someone just getting started with it. There are hundreds of tools out there of varying types and quality and usefulness. I want to demonstrate usage of some of the best tools out there with an emphasis on free/open source tools when possible due the fact that not only are they easily obtained, but also customizable as you, dear reader, have access to the source code.
One of the things I enjoy about writing software automation is that while it doesn’t have any truly complex code in practice (what Holmes refers to as “heavy lifting code”), it usually places a strong emphasis on pulling apart the software you are testing and trying to figure out how it works. By the same token, our code is going to be revisited for maintenance approximately twice as often as the software it is testing:
- We need to change our code when the software we are testing changes
- Our own enhancements and bug fixes
By the same token, we tend to be our own customers so we can tailor our code to fit our own “craziness”.
Initially, I plan to start with web test automation using Selenium Web-Driver. It is one of the more popular open source tools, is quite powerful, and supports the most widely used browsers in the US, if not all of them: IE, Chrome, Firefox, Safari, and Opera. Furthermore, it runs on Windows, OSX, Linux, and Solaris. Finally, it works with C# (my preferred language), Java, Ruby, and Python. I should also note that because of the way it works with C#, it’s conceivably possible to make it work with almost any .Net language.
My primary focus is going to be using C# in a Microsoft ASP.NET or MVC project. As I start, it will be helpful if you have at least a basic understanding of coding. You should be able to understand these posts if you have read any introduction to programming book (Bruce Eckel’s “Thinking in Java” or “Thinking in C#” are both good resources).
Later on, I’ll recommend other sources, but I don’t want to overwhelm you at this point.
WITH ALL THAT OUT OF THE WAY – LETS GET STARTED!
The first thing you are going to need is the various tools you will use. That will be the focus of this first post.
First, head over to Microsoft and download and install Visual Studio Express for “Windows Desktop” (Download Visual Studio). This is the IDE where you are going to be spending most of your time for this first batch of exercises.
Next, head over to the main Selenium website and download
- The C# Selenium Client Driver
- The 32-bit Internet Explorer Driver
These are collections of files that do not require installation, but you will be using these bits of code a great deal.
Finally, you are going to want to grab developer tool add-ons for your browser. You are going to rely on these heavily in identifying bits you are coding against.
Note that, for each of these, download/install them with the browser they are for. Its not technically necessary, but each of these install more easily that way.
- For IE, you need the Internet Explorer Developer Toolbar
- For Firefox you need Firebug
- For Chrome you need it’s toolbar
OK, now that you have installed all of that, it’s time to sit back, relax, drink your favorite frosty beverage and comment below on how I don’t know what I’m talking about!
P.S. and yes, I WILL talk about writing tests in future posts!