I work on automation scripts written in selenium using Java at my current job.

I want to expand my skills and learn a scripting language to help with more advanced UI automation.

After research I have decided that Python or Javascript would be good choices, but I am not sure which would be better for web UI automation.

What are the key advantages and disadvantages of learning and using Python vs learning and using Javascript for advanced UI automation, especially web UI?

  • 1
    I have edited this question to make it less of an opinion-based question and more suited to our preferred format. – Kate Paulk Jul 17 '17 at 11:36

Any language is a tool to solve certain kind of problems, so (if you allow me to slightly exaggerate) you are talking between which tool you should buy: a hammer or a screwdriver?

Every such selection will have pros and cons, so only you can decide which pros are more important for you.

But in common situation like yours, I would advice to go for Python, without any hesitation.

Both languages are similar in sense they are both dynamically typed with flexible data literals (as compared to Java) and both are widely used for web UI automation (which is more than just automated web regression testing).

Python has more wide use outside of web automation, for different tasks you may encounter around testing, for generic system administration tasks like moving files around, writing cron jobs, and just general text files parsing and manipulation, like generating test data.

OTOH Javascript is THE language for UI development, Angular, Protractor, etc. I think this is smaller niche than Python, because you ALWAYS need to manipulate the files.

Also because Python has more careful design more oriented towards reading programs by humans, Python community finds it easier to collaborate and share the code. With Javascript, it is easier to find low-quality examples of the code. It is not as bad as PHP but close. :-) Javascript is closer to Lisp than to Java, because it is prototype-based, not object-oriented, and it's name is just marketing gimmick.

Python is object-oriented (closer to Java) but not as object-obsessed as Java is (you can also program in procedural style, or functional if you want and need), but there are some subtle differences with Java too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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