What Selenium Programming Language You Should Learn

What Selenium Programming Language You Should Learn

So what selenium programming language should you learn? I recently received the following email in my inbox:

Hi Joe,

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.
  • 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.

Learn Seleniun

Get started programming today! To get up to speed faster go to my The Best Resources for Learning Selenium Quickly guide.

Stan - June 5, 2015

I would choose Java as a programming language. You are right that commands to work with Selenium and browsers look similar for different languages. And there are not much difference on this level. I would say it’s the first level. But you will going to build solid framework and you will have to add the several levels of abstraction above the Selenium command. So you will create abstraction of the domain (Web pages, flows, etc) you work with. And it’s important to do right choice here. I would vote to Java (even for .Net projects) because it has huge support and comunity, it has great frameworks you will need and infrustructure. And the most important this language has great capabilities (classes, interfaces, types etc.) to build and manipulate the levels of abstractions to build your solid framework.

    Joe Colantonio - June 5, 2015

    Great info Stan and many other automation experts like Alan Richardson would agree with you.Also you reminded me that for testers that have to learn Java to start automated in their companies Alan’s Java for Testers book is a great resource. I’m personally torn because sometime I think some teams create over complicated frameworks that only a few can understand and maintain were frameworks created with the scripting languages like Python tend to me to be more straight forward.

Testing Bits – 5/31/15 – 6/6/15 | Testing Curator Blog - June 7, 2015

[…] Selenium – What programming language you should learn to get into Test Automation – Joe Colantonio – https://www.joecolantonio.com/2015/05/31/selenium-what-programming-language-you-should-learn-to-get-i… […]

Sandeep Kumar - June 11, 2015

I personally love to build selenium frameworks in ruby. In addition to be able to write solid test automation frameworks, the agility and the speed with which we can write and spin off tests is very important. The learning curve of the testing team adopting test automation is also very important. Ruby scores extremely high on these parameters. In my recent gig of automating a middle ware containing message queues, web services, API and gateways, the test automation framework I have written in ruby was adopted so easily by the team and they were able to write 100s of tests organically.

Adam - September 18, 2015

Best Resource that actually answers this very important question!! THANK YOU!!!!!!

    Joe Colantonio - September 19, 2015

    Thanks Adam!

Ramon - October 14, 2015

Nice one Joe!

Greg Meece - January 26, 2016

I would also like to put in a plug for Robot Framework. It has its quirks and issues, but if you have to vet your test cases with non-technical stakeholders, it is ideal. It is written in Python, and you can extend it with either Python or Java. Besides Selenium testing, it can also do database (SQL and Mongo), SSH and Telnet, Process management, mobile testing (IOS and Android), etc.

Check it out at: http://robotframework.org/

    Joe Colantonio - January 26, 2016

    Thanks Greg – I agree. I actually have an upcoming TestTalks episode where I talk with the creator of RobotFramework Pekka Klärck

Sally - December 5, 2016

I want to ask , what are the best tools I can use to apply model based testing , and recommend me an adapter if it is required

rup - December 5, 2016

I’m late to the party – but I agree that it depends on the company. However – one language that seems obvious but is still barely discussed because of how QA has been conducted over many years – is JAVASCRIPT.

I am currently implementing an automated test suite in javascript at a startup – and a good deal of startups these days center around javascript apps.

But I’ve been absolutely astonished at the paucity of resources concerning things like Selenium-webdriver for node.js. It seems the entire QA industry has persisted in using Java so stubbornly in isolation of trends that it rarely occurs to even the most seasoned pros to use javascript for testing. Protractor has helped a bit to popularize the concept but that’s too angular focused. People should really begin taking webdriver.js (Official Selenium bindings) seriously, along with other alternatives like casperJS, Nightwatch, and webdriver.io.

My prediction would be to stop thinking of Java as the default language for tools like selenium, and to begin using javascript with node.js. WordPress.com uses the node bindings for selenium webdriver and if it works for them it can work for any javascript app that requires testing.

    Joe Colantonio - December 6, 2016

    Hi great points – and I agree! The last year I’ve been hearing more and more folks raving about javascript. I have to admit I hate the syntax myself but it really has become the must know language of the web.

Velavan Palanisamy - February 2, 2017

Is it feasible to use F# – Functional Programming Language ?

    Joe Colantonio - February 3, 2017

    Actually there is a tool called Canopy that you can use F# with Selenium

Angry Test - March 14, 2017

You see the problem is you can learn a language like Java set up a framework and then your all good, but then the market changes and everybody and they dog wants you to know C#…with Selenium the issue for me is that recruiters here in UK will not waste time looking at you if your CV does not have some sort of job where you have used so then your are screwed.

Even with code examples on my github and course after course after damm course i cannot get a look in all because i was not a dev in my former life!

Its chicken and egg! You cannot expect a manual tester to spend several years learning automation and just because he does not have it on his CV the title of automation engineer say “oh you cannot do that job” “but we have a good manual role”

UI Automation is messing up the testing industry because tester s like myself who spend the time and put in that work cannot get a role for love nor money!


Click here to add a comment

Leave a comment: