Thursday, 2 June 2011

How can I learn to automate my testing using Selenium?

In this blog post, I’m going to lay out the Evil Tester free and simple 8 step guide to learning how to automate a Web Browser using Selenium.
I’ll reveal the sources of information you can use.
And yes, I will promote my book.
music by Drongomala @ flyingmountainrecords.com
I see the same questions, and variations on these questions, asked on social network forums every few days.
    • “How can I learn Selenium?”
    • “How do I use Selenium?”
    • “What do I read?”
    • “How do I get started with Selenium?”
    • “I want the answers. Please do the needful”
For some reason the previous answers don’t stick. Or people can’t find them. Or maybe they don’t look for them. Or, something… I don’t know.
But a lot of people have tried very hard to make Selenium easy to get into, and to help get you started. So if you are prepared to put the work in. The Answers are out there. Just don’t expect someone to magically drop the information into your brain, you have to put the work in to follow the learning steps.
Expect to put in some work.
If you are prepared to do that.
Then the pointers in here will help you.
First learn a bit about Selenium
Start with the basics.
Research what the tool sets out to do. Visit the official site. Have a look around.
Need/Want more than the Official Documentation
You can read two books:
I wrote a comparative review of them here:
Both David and I wrote our books when the Official documentation was harder to get into than it is now, so we aimed these books at the beginner. If you consider yourself a beginner and find the official documentation too hard. Then get hold of these books.
The official documentation has improved massively and the Selenium team have done a great job. These books go beyond the official documentation and add additional value. Sometimes people need more in depth tutorials, and more examples, more code samples, and these books provide that.
Selenium is Open-Source, Learning should be free too
OK, if you say so.
Both books have free previews. And these are big previews. Last time I checked mine was 75 pages. At the end of which you will have installed all the basic tools. Recorded a test in the IDE. Converted the test to Java. Run the test in the Eclipse IDE. Learned how to debug tests in an IDE.  Learned how to start and stop the Selenium Server programmatically. And given pointers of where else to look for more information. For some training courses, that would be day 1.
They cover:
  • installing the tools you need,
  • recording your first script in the IDE,
  • converting that into program code – because you do not want to get stuck in the IDE
And all of that in the free previews.
My book leads you through the process of automating some basic web pages and covers automating most of the common HTML features, automating AJAX, and refactoring your tests into Page Objects and building an abstraction layer. And even through the steps needed to put your tests into continuous integration. All in a consistent tutorial guide.
Read this comparative review, follow up the links, read the previews and tables of contents and see which books meets your needs.
More than enough to get you started. Enough to have you install the tools. Enough to get you moving.  In just the free preview.
Search for blog posts on how to start, here are a few searches to try:
And let’s not forget the official site http://seleniumhq.org
A lot of info out there. Some of it will be out of date. They will repeat and overlap. They will not be presented in a consistent style. But you can get all the information you need without buying the books if that is the learning style you prefer. You will learn from your mistakes as you follow the instructions. That learning will help you.
Where can I get help when I start learning?
The official site has a page all about that:
The bigger point though is not “where” but how you use that help.
  • Don’t ask generic questions.
  • Show the source code you were using when you got stuck.
  • Make sure your learning how to debug the scripts and have investigated it as far as your knowledge will take you.
People have put a lot of effort in simplifying the learning of Selenium but it still requires you to do some experimentation and make an effort.
You are learning how to code, and do some complicated stuff. Automation often requires workarounds, so if you don’t get into the habit now of trying different things, of exploring the API, of searching for tips around the area you are automating then you are doing yourself a disservice in your learning phase.
What else can I read?
I’m going to give you one link:
http://seleniumhq.wordpress.com
Adam Goucher does a great job, scanning blogs looking for material on Selenium. So follow up the links. That will take you to more blogs. Read those. Subscribe to those in your rss feed.
But I hate reading!
Fine. There are plenty of videos out there. Lots of Videos out there:

This all sounds like hard work
The learning process requires that you make an effort.
But its your choice. You do not have to learn how to use automation tools. Personally I think that will help your career and provide you with more options in your test approach, but you don’t have to learn it.
If you choose to learn it, then you have to put the effort in.
  • Learning involves Experimentation.
  • Testing involves Experimentation.
You already know how to do both those things.
Well, Automation involves experimentation too.
And remember – if you get stuck
Remember there are two books which aim to help you learn Selenium.
I wrote Selenium Simplified for the very reason that people do get stuck, so it provides step by step instructions for getting you unstuck and productive in Selenium.
Time to start now
The onus is on you. Right Now.
Just start following the 8 step process:
Step 1 - Read the official site and selenium documentation
Step 2 - Start trying to use Selenium using the documentation to help you
Step 3 - Investigate the books available, use the previews to get started
Step 4 – Auto-generate scripts from the IDE
Step 5 - Use Google to find tutorials, blogs and videos
Step 6 - Use stackExchange, linkedin and the Selenium Forums for specific help. Read the official support page
Step 7 - Read through the old issues of "A smattering of Selenium"
Step 8 - If you get stuck, and can't make progress - buy one of the books. You can apply this step at any time.
You can learn Selenium. Start Now.

1 comment:

  1. Very nice, but there a very simple example how to use Selenium and maven plugins in my site http://english.valdemarjr.net/2011/03/04/functional-tests-with-selenium-2-0-and-cargo-maven-plugin/

    Congratz by post.

    ReplyDelete