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?