October 13, 2012

What is the Best Way To Learn Selenium?

(a small rant on asking answerable questions)

xkcd comic 386

At a certain online QA/Testing Forum I regularly visit, the Selenium forum is one of the most active.

I continuously see newbie questions like: "How I do I learn Selenium?", with little or no other context given.

Then, helpful responders chime in with tangentially related answers. That's about as good as you can do, based on the lack of information given in the original post. This happens often and wastes significant brain activity in the responders, while generally giving no value to the OP or forum community.

So first... a clarification:

Selenium WebDriver is a system for automating browser interaction. It is accessed via programming library/API. If you want to use it without touching code, it is not possible (record/replay/export-madness via IDE aside). You can abstract away most of the programming aspects with higher level frameworks, but at that point you are no longer really dealing with Selenium anymore.


Here was my response to a recent forum example:

Question asked:
"Best way to start learning Selenium - I would like to know what is the best practice to start with Selenium for non programmers. Is there any books or ebooks?"

The responses compelled me to chime in with a rant:


To anyone on this thread looking for the "Best way to start learning Selenium":

Think of it this way:

Selenium (WebDriver) provides language bindings and a similar API for several programming languages. It gives you a programming library that can manipulate a browser and web elements/controls.

You can't "learn" a library for a programming language if you don't know the language itself (syntax, idioms, etc).

So the question shouldn't be: "How do I learn Selenium?", with no other information or context given.

Selenium should be used with either: the supported language that you are most comfortable with, or the language of the system under test you are working against.

If you are looking for information, be specific about what you want to learn. General understanding of the components that make up Selenium is great, but really, using the API's from any language is the best way to learn. If you specify a programming language along with your question, at least answers can be directed towards frameworks, code samples, documentation, tutorials, etc, that are *relevant* to you.

Diving into the main Selenium docs can be confusing at first, as it covers things from a general level... mixing in code samples from various languages.

So, my question to you: Which programming language are you going to use Selenium with? If you define that, someone can surely help point you in the right direction.

How are your programming skills? Which language do you want to learn in? If you know several, switching is trivial down the line, as the API's are similar between languages.

If you don't have skills in any Selenium supported programming language (java, c#, python, ruby, php, etc), then learn one of those before you even touch Selenium. If you have a language in mind, please phrase your question using that in context.

happy hacking,

-Corey

p.s. now go RTFM: http://seleniumhq.org/docs/


rant over.