Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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
2  
Do you work with devs - if so, what do they use? Why not Ruby? Or Perl? –  Phil Kirkham Feb 5 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 at 6:41
1  
See also sqa.stackexchange.com/questions/1674/… –  user246 Feb 5 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 at 14:27
    
Let's discuss that in Meta. –  user246 Feb 8 at 14:29

10 Answers 10

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: https://www.udacity.com/course/cs101

Software Testing: Teaches testing, by writing Python test code https://www.udacity.com/course/cs258

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 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 (http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html). 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 at 11:03
    
thank you, edited. –  amazpyel Mar 11 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

Git

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

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:

http://aroraglobalservices.blogspot.com

share|improve this answer
2  
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 at 7:58

Your Answer

 
discard

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.