So what selenium programming language should you learn? I recently received the following email in my inbox:
I am interested in learning Selenium under your guidance. So will you please guide me from where I will start my learning? What language should I learn to program Selenium in?
I get this type of email request at least once every few weeks, so in this video I'm going to reveal the selenium programming language every beginner should use to learn Selenium.
The Selenium Programming Language everyone should learn is…
Ok. Are you ready? The secret is – honestly, it doesn't matter. 89.2% of the concepts you learn in one language can be applied to any other language.
The real key to learning Selenium is to just select any language that you are drawn to, roll up your sleeves, and jump in.
Why what language you choose doesn't it matter?
In Dima Kovalenko's book Selenium Design Patterns and Best Practices, he discusses how the common Selenium command sendkeys translates in most of the other major Selenium Language bindings. Check out the example below:
(*Also be sure to check out my interview with Dima for more Selenium automation awesomeness)
This uniformity between the different Selenium language bindings applies to most of the commands in the Selenium API.
So, you can see how easy it is to transfer your knowledge of one programming language approach using Selenium to another with little effort.
Also — the general programming concepts you learn in one language can easily be applied to another. Once you learn things like program design, control structures, data structures and basic operation, learning another language becomes simply a matter of learning its particular syntax.
But … which one would you recommend?
If you were to force me to name the language you should use, I would have to give you the famous (and annoying) reply, “It depends.” Some factors that might help you decide are:
- What language does your company currently use for their development? If you work in a Microsoft shop and everyone uses Visual Studio with C#, then maybe that's the language you should start with; if your developers are open to helping you out.
- Java holds an advantage because it is widely used, and easily finding examples on Google to help you out when you're stuck is a plus.
- If you were to do a search for Selenium automation jobs near where you live, what is the most popular language requirement that comes up? That might be a good place to start.
- The cons of starting with a programming language like C# or Java is that they can be overly complicated since the syntax tends to be verbose.
All languages have their pros and cons. One is not better or worse than any other. It really does depend on your situation and what you are trying to accomplish.
If I was forced to choose
I personally feel that if you have never programmed before, it would be best to start by using a script-friendly language like Python or Ruby.
Using a scripting language allows you to learn to write Selenium tests with the least amount of code in the shortest amount of time.
For example, Python has always been my go-to language for absolute beginners because it has a really gentle learning curve. It works on Windows, Linux, and MAC, and it's also still considered to be a serious programming language that many professional developers use.
My final answer/recommendation
So, to recap: What language should you use to learn Selenium? The answer is that there is no definitive answer — but hopefully this has helped you narrow down which language is right for your personal situation.
Discover how easy it is to learn Python
I recently interviewed Al Sweigart, author of the book Automate the Boring Stuff with Python: Practical Programming for Total Beginners. I highly recommend that you listen in to get an idea of how easy it is to get started creating automated tests using Python.
Get started programming today! To get up to speed faster go to my The Best Resources for Learning Selenium Quickly guide.