Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Should I learn Python or Java to get into test automation?

I'm new to programming. Please share your thoughts or links to any useful information.

share|improve this question
Do you work with devs - if so, what do they use? Why not Ruby? Or Perl? – Phil Kirkham Feb 5 '14 at 4:26
I want to learn selenium webdriver, but I do not know how to code. I'm a manual tester who wants to get into automation. – pythonjava Feb 5 '14 at 6:41
See also… – user246 Feb 5 '14 at 15:36
This is so close to the question @user246 pointed out (which has a lot of good answers, and is better worded) that I'd be inclined to close this as a duplicate if it didn't already have some good responses. What do you think? – testerab Feb 8 '14 at 14:27
Let's discuss that in Meta. – user246 Feb 8 '14 at 14:29

13 Answers 13

Since you are looking into Selenium (as a test framework) start with Java, because Googling on "Selenium/Webdriver issue description" will often result in Java examples that you can re-use. There is just more people doing Selenium with Java then Python. Also Selenium it-self is mainly written in Java.

For a project I would learn the language the application (under test) is written in. As a tester your are often not a hardcore programmer, thus if you need assistance with the test automation its ideal if the team can help you in a language they use on a daily basis and have the most experience with. This will also increase the adoption and extension of your tests by the developers, they will have to maintain/extend the tests in the end probably.

If your learning preference is from books I suggest "Thinking in Java" each chapter has great programming challenges to make sure you understand and can apply the theory. Also it explains everything in great detail.

Update: Also Java looks a lot C++ and thus also C#. If you look at the most popular languages the C derivatives are most popular. Learning Java will make it easier to switch to other languages.

share|improve this answer

It is not compulsory to learn Python or Java for Automation but it would be better to know Java concepts(or python concept if using python in Automation) and basic fundamental of language.

If you need to know and understand core of framework like selenium or testNG then you should have good knowledge of Programming language knowledge.

share|improve this answer

I'm a fan of the Udacity classes: Computer Science 101: uses (and teaches) Python basic CS concepts, while building a search engine:

Software Testing: Teaches testing, by writing Python test code

share|improve this answer
While these are useful resources, they don't really answer the original question. (Admittedly the original question does ask for links, but what's your view on the main question?) – testerab Feb 8 '14 at 14:23

It depends from software development branch you want to come. But I suggest you to learn Java because this is one of the most popular language at nowadays ( If you will learn Java you shall develop tests for Desktop, Web and Android. Also I suggest you to learn Python, Shell, Javascript - they are easy to learn and a lot of application may to use.

share|improve this answer
Maybe you could give some more information on factors that would influence the decision? That would make your answer more useful. – Kate Paulk Mar 11 '14 at 11:03
thank you, edited. – amazpyel Mar 11 '14 at 11:22

For Automation testing you have to learn programming language. Sure, first steps may be to do with play-and-records tools (like Selenium IDE or CodedUI)

But for solid framework system you should write heap code, use patterns, debaggs and storage code in CVS system (git or svn).

My opinion, the first language must be same which your developers use. They can help you and get good tips hot to use code.

For first steps in dev follow next links:

WebDriver docs

Codeacademy where you can do first steps with python, ruby and more

Webdrives patterns


Good luck!

share|improve this answer

If you are going to learn it on your own (in case your company does not buy an expensive automation tool that you MUST work with) I advise you to start with basic programming language courses, preferably the same as your devs use, buy a book on it and start from the beginning

After that look at webdriver documentation and start building a framework (a set of functions that you use regularly in order to save time and make your code readable and easy to debug). I think is better to use "C# + Visual Studio + Git" or "Java + Eclipse + Git", these are the ones I know better, if your devs use python or ruby they can help you with that.

Anyway, just speaking from my own experience, no fundamental knowledge here...

share|improve this answer

The answer is yes and no.

You should have knowledge about programming to be able to adopt the situation you are in. When it is needed you should be able to learn the particular language to write automated tests. For example, selenium can be used with many languages because there are little differences in its API. So that, the point of the "pick up new stuff" situation is the programming language itself and the technology (if you are in java environment you should know what the difference between pure java and JEE) not the selenium itself.

Here is my situation. When I started working in IT I only knew php. Later I learned java and I wrote a lot of automated UI tests using Selenium in java. Later, I changed my job and I had to learn how to do this using c#. Now my girlfriend has to learn how to do the same using Ruby and she asked me to help, so that I had to learn Ruby. The more time I go through this "pick up new stuff" process the easier to pick up the necessary knowledge to do my job.

Sometimes my job was only testing not to write automated tests because it was the developers' tasks as well. So, as you can see to create automated tests it is not necessary to have programming skills because, sometimes, test automation is part of the development tasks. However, if you are able to take part not only test creation (BVA, QP, etc.) but also test automation you will be respected not only because your knowledge, but also your attitude.

The backside of the whole is that, my knowledge is superficial ( I dare say that my skills would be enough to be an experienced junior programmer, however my whole IT experience would be enough to be a senior due to the stuff I have seen so far), so I have to spend time to make it stronger. But, as a tester I'm a respected because I have skills and I learn fast.

share|improve this answer

Personally I would have to recommend that you learn Ruby. Most of the BDD automation tools like Cucumber and RSpec are coming from the Ruby community and it offers a wealth of test automaton tools available.

As you are new to programming, I highly recommend that you head over to code academy and do their free online ruby training.

I would also recommend that you grab a copy of the Cucumber book and start working through it.

share|improve this answer

Below is some documentation for Selenium as for each particular language it accepts:

These should help you get a start with Selenium in each language.

Here is a detailed comparison between Java and Python. It explains how Python is typically more concise than Java, which is very true. With Python you are likely to end up with far less code. This can be a huge benefit and make it far easier to learn Python.

Personal Preference

If I had to choose between Python or Java I would likely choose Java. It just has a better future and is more likely to be what is being used by the system than Python. Also it is, in my opinion, a lot easier to learn.

If I had to choose between all languages, I would likely suggest Perl for software testing. A lot of testing has to do with verification and strings, Perl is likely the best languages for this. Also, get started with regular expression as quickly as possible, it will pay off big time. And since Regular Expression's basics transfers throughout the majority of the programming languages it will give you a huge advantage over a lot of the other testers in the market.

Ultimately it depends on what your attempting to accomplish. Do you want to be great at your job or do you want an impressive resume? I can list 9 programming languages on my resume since I dabble in a lot of them for different situations. If I need to do a lot of String parsing, I choose Perl. If I need a quick script, Python. Something more advanced, Java. And since my company seems to love ASP for all of their QA stuff, when I need to update our internal QA sites, it's usually ASP.Net.

share|improve this answer

I would suggest Python as it is very easy to learn. If you are going to use Selenium webdriver then you can go through the documentation and sample code at

share|improve this answer

Nowadays, irrespective of being a developer or tester we all need to know a development language and my advice will be: either Java or Python both are doing equally good; but learning python is easier, number of lines of code in python is also very less for given functionality, maintainability of code is easier and structuring is also very simple compared to Java.

However resource availability (namely libraries, tools, end to end integration support) for Java is a little higher as Java is widely used.

Nevertheless there a is big turnaround in Python from past 4-5yrs and it's taking over the software industry and future seems to be Python as it's evidently introduced even at schooling level (in India & rest of the world I am not that sure though) and there exists no Java in there and C++ is optional. Lots of Python utilities are available to fulfill the needs of most of the technical sectors.

From jobs point of view of today there are more jobs for Selenium with Java than Selenium with Python.

Java is a really good language too, but it takes more to learn Java than Python.

Now how long you want to code is one of the important decision you need to make!

share|improve this answer

It all depends on your project requirements and tools to be used. To start with automation testing you don't necessarily need to master any language upfront.

Of course, knowing a programming language what your tool is going to be used or designed is helpful. It's better to start with understanding the concepts and framework for automation.

For selenium webdriver,as all said, one can start with basic Java skills. For the question of Python vs Java, a few factors play a role

  1. Type of project
  2. Automation Requirements
  3. Type of Tool
  4. Scripting language required to operate the tool.
  5. Lately the type of framework

On the other hand, it's always complementing to have scripting skills. For QA, Perl, Python, VBScripting etc are a few of the useful skills.

share|improve this answer

If you want to learn Selenium as an automation tool, I'd suggest you to learn it via one of the best blog and get your queries answered as well:

share|improve this answer
Welcome to SQA Ashish. The question specifically is trying to decide what language will offer the lowest barrier to entry considering the primary factors of being new to programming in general and new to test automation. Is there a specific article that you could pick the best advice from and incorporate into your answer? Also if you are at all related with the service you're listing, you need to disclose that affiliation. =) – corsiKa Jul 18 '14 at 7:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.