Very important Question about choosing a language for automation

Hi everyone
I need information about if you were to learn a language to use for writing automated tests what language would you choose (of course in this case I don’t know what language is used in my future work) I have access to the code and I know the concept but what would be very useful to learn, just To mention, I have been working as a QA for 23 years and every time at work I learn a little bit of everything but do not use it because there is no opportunity, but this time I decided that I want to specialize in one of the languages.

2 Likes

It depends a bit. But I would follow the same language as the project. Considering you will work in the same repository, you can easily reuse util functions and add data-testids without much effort. Also, based in the tools (such as cypress and playwright) I’d say javascript/typescript is the way to go.
In the end it all comes down to your preference and how comfortable you are with the specific language.

Hello and welcome!

I answered a similar question about learning coding in general with some ideas that I think will apply here too

Long story short: it doesn’t matter that much. You’ll have to pivot to a new language based on what your company uses, which is often based on what the developers already use and the kind of program you’re writing checks for.

Use any suitable example to learn the concepts behind coding and automation, then pivot to the new system.

Also the testing side of automation is important to understand. Automation is just tools used to help testing, so deciding on what to put into automation is important. An understanding of what automation is good at, what it can do, what adds to costs of writing and maintenance, what is worth repeating, what change does, what makes automation valuable and what makes it flaky and expensive. That’s powerful knowledge to take into a coding project.

2 Likes

I agree with @lufis.

Ideally it would be the same as the product but if in your case, since it’s unknown, I’d go with Javascript/Typescript (mostly because there are more jobs out there).

Computer languages are like power tools and hand tools, every tool has it’s place. This question has been asked before, and I feel unable to not interject again. Choose a language like you would choose a tool. One that rests nicely in the palm of your hand and makes you feel like a superhero about to effortlessly save the world. Like you said @bitanmk testers generally do have to learn multiple languages, but only how to read them, not to write in them all. Your automation language choice needs to support the job it will be applied to, choosing Java for automation just because the app is a Java app is not a sensical decision if Java has no testing “jigs”. It’s too easy to choose “same as dev” just because it will mean that developers won’t have to learn two languages (It just happens that Java is a good test language choice though!)

Choosing what the devs use is really a weak answer, because unless customers are buying the “code”, they don’t care about the product language choice. Moreover if the app is written in Cobol 16, you might struggle to find test tools. If customers do buy the code, then they probably do prefer the tests in the same language, that’s the corner case to be aware of. But generally no. Example: if the product one day gets rewritten in RUST from C++, you will suddenly find your test code becomes dead baggage. But if you choose RUST already as your test code language you are probably in an awesome place if you get my drift. It’s very much context specific, choose your test tool based on the criteria the product must meet first, then only look at what the language flavour of the month dictates.

2 Likes

In addition to what has already been said:

  • If you prefer front-end languages such as JavaScript, or like Python, or hardcore languages like Java, feel free to follow your preference. Given the great demand, there is nothing wrong with respecting your known likes and dislikes. And if you don’t know yet, you could first play around with several languages for a bit and then choose.
  • The language the devs use can be a good choice. Not to please them, but 1) because they can help you learn faster and better (at least through code reviews) and 2) they can do some of that work (especially the trickier framework code that should be solid, but perhaps also to automate checks).
2 Likes

100% on that point @martingijsen about using a language the developers know already, because most of the Java I have learned has been from developers on my team who love it. I’m not a Java fan at all, but being open to trying anything under the sun out for a while to broaden your skill at it is so valuable.

The big thing to be aware of is suitability of choice. I had a project waste half a year on trying to use C# as an API testing tool only to have it fall over under the strain or constraints the system came under when we suddenly had more than just 2 or 3 testers contributing. “Compiled” languages and strongly typed languages have their specific use cases, and your testing problem needs to require a strongly typed language for it to really fly. If for example it does not require one, don’t choose one unless there is another good reason. Knowing multiple languages, and their strengths is yet another arrow in your quiver, always choose the arrow you feel most comfortable with reaching your target.