Javascript/Typescript VS Python for test automation and more

I have some experience in programming (mostly OOP) and test automation with languages other than Javascript, Typescript and Python. I am considering picking only one language for now - Javascript/Typescript OR Python. Can someone help me to figure out which one is likely to be better for me? Here are my requirements.

  1. The language should be one of the top 3 languages required for most Web UI & API test automation jobs. Suitability for mobile and AI testing is a plus.

  2. It should have a lot of diverse learning material like books and courses i.e. the books/courses should go beyond just teaching syntax and toy projects (Books for most languages do this). Instead, they should provide plenty of realistic practice with several small projects (bad word filter, number guessing game etc.) and medium sized projects (scraping websites, controlling mouse and keyboard etc.).

    I see many books for Python from No Starch Press which meet these requirements and some from Manning too (Python Workout). But few No starch has few books for Javascript or Typescript. It might be because Python has been around for longer than Typescript. So, the choices of learning material for JS/TS don’t seem as diverse.

I am not sure if Python meets requirement 1, but it appears in many job postings. I’d like to see some stats. But I am leaning towards Python mainly because of 2. If Javascript/Typescript can meet requirement 2, then I’d like to use it instead of Python. I see a lot of jobs for Playwright these days which need Typescript (not Javascript).

python is good, i know C# java python and general html with javascript knowledge, c# is least you can encounter. java is companies go to languages but you can do everything in python. but you lost some abilities, such as inheritence this cause OOPs hard to manage you need to virtually create inheritence, base and action classes and maintain it. AI tends to write everything in one python script so if you learn python when you use ai you had to specify in prompts

for the requirements you listed, i’d choose TypeScript first. it keeps you close to the browser, Playwright’s primary examples and types are excellent, and the same language can cover UI tests, API setup, mocks, and small Node utilities.

i would validate that against 20 roles you would actually apply for, not a general language ranking. count required languages and frameworks. then build one medium project: create test data through the API, run a Playwright checkout flow, verify the backend result, add fixtures, parallel CI, and a trace on failure.

Python is the better first pick if AI or data automation is the main goal. for web UI and API testing jobs, TypeScript gives you the tighter practice loop.

I would definitely choose TypeScript. I personally don’t remember having seen any job ads for automation skills paired with Python. Python would be the better option when dealing with data and scripts, but it doesn’t sound like that’s what you’re looking for.

I also just prefer the TypeScript language.

@cassandrahl Thanks. Why do you prefer Typescript? Do you like it more than Python?

@dwaynesamuels, @cassandrahl Thanks. TLDR - Python it looks like Python is in more demand than Typescript (or at least comparable).

I tried Dwayne’s approach with a small modification. I looked at 54 remote jobs (my preference) in a job website, instead of looking specifically for jobs to which I would actually apply (This would require reading the company description at a minimum or much more research. Maybe this could be faster with AI assistance). Here is what I found -

Total jobs - 54
Typescript - 12
Python - 24
Other - 18

Notes -
If a job mentions py or ts or both, then count it as py.
If a job prefers ts over py, then count it as ts.
If a job does not mention any language, or does not mention py or ts, then count it as “other”.

I made sure that my job filters only look for remote jobs and not any language.

I see Playwright in many of the “other” jobs. Some of those jobs mention js (sort of related to ts) and some don’t mention any language (Are those jobs likely to require js or ts ?). This “other” part could skew the results in favor of Typescript if I had more clarity.


My experience today is the opposite of Cassandra. I saw more of py and less of ts. It could be just luck. I am not trying to justify my tilt towards py which is mainly because of more and better quality of learning material. I am trying to see what to learn next. I hope I am not overthinking this.

I do see a problem with the Python language now. It uses indentation (whitespaces) to organize code instead of curly brackets like other languages. This can lead to logical errors like the one mentioned below. I don’t know if this is a major problem for most of the python users, but it seems like a major problem to me.

# pseudocode
for person in array:
print(first name)
print("welcome")

Looking at the above code, I wonder if you want to welcome each person or do you want to welcome all of them together. This is the kind of logical error I want to avoid. There are multiple things to help avoid such errors like identation guides in IDEs, linters like Ruff and Pylint (which can detect such suspicious coding patterns), avoiding deep nesting, writing better tests etc. But, I’d like to have the safety of an explicit curly bracket.

This makes me wary of using Python. BUT, the quality and diversity of learning materials is amazing IMO. I haven’t seen it for Java (a while ago) and certainly not for Typescript. For Python, there are books actually teach you with realistic projects that usually do not need basic front end development skills unlike Typescript (or Javascript). These projects can give you the basics to automate tasks in your personal life or on the job. So, I will be using Python for now. Lets see how it goes and if this indent thing actually becomes a problem for me.

Yes, I prefer TypeScript. I find it more user friendly and easier to understand. Python is often cited as the good “entry-level” language, but it’s not for me.

It’s definitely a good idea to research the specific roles, industries, locations, etc. you’re interested in, as things do differ across those aspects. The thing that immediately jumps out at me is, “If a job mentions py or ts or both, then count it as py”. That’s heavily biased towards Python, and it would make sense to count these separately (as an explicit, “it doesn’t matter”) or not at all (since it makes no numeric difference).

Honestly, there’s no real “wrong” answer - you will benefit from learning either. Good companies / hiring managers know that coding languages can be easily learnt, and other skills are more important in this context. That’s why some say either is fine.

You seem more motivated to go with Python. Maybe try it out for a while and see how you like it. You can always change your mind, nothing is set in stone.

My preference for application test automation is generally to use the same language the application/development team already uses.

So if the team is building the application in TypeScript, I’d lean towards TypeScript for the automation as well. One of the biggest benefits is that it lowers the barrier for developers to understand, review, debug and contribute to the tests.

If the development team works mainly in TypeScript but the test automation is written in Python, you’re potentially creating another technology stack they need to learn before they can contribute. That can make it more likely that the automation becomes something primarily maintained by the test team.

That doesn’t mean Python is a worse choice. Python is extremely useful for tooling, scripting, data work, hardware/device integration and AI-related work.

I’d also think about the types of roles and companies you want to work for. Whichever language you choose will naturally make some roles easier to move into than others.

For example, I see plenty of roles where the wider stack is heavily .NET/C#, and because that isn’t really my stack, I’m less likely to apply for them. The same can apply with Java, Ruby, Go, TypeScript, Python, etc. I’m also seeing Go appear more frequently in engineering stacks lately.

So rather than choosing based purely on which language is most popular in test automation, I’d probably spend some time looking at the jobs you’d genuinely want to apply for:

  • What languages are those companies using?

  • What are their applications built with?

  • What test frameworks are they asking for?

  • Are they looking for someone who can work across the wider engineering stack, or mainly maintain a separate automation framework?

Then use that to help make the decision.

For me:

Application test automation: I’d usually follow the language of the application/team.

Tooling, hardware, data, AI and scripting: Python is extremely useful.

Career choice: Look at the companies and roles you actually want and see which languages and ecosystems appear most often.

If I were joining a TypeScript development team and building Playwright automation for their application, I’d choose TypeScript. The bigger goal for me is making the automation something the whole engineering team can contribute to, while also building skills that keep me relevant for the sort of roles I want next.