I've seen in lot of job advertisements, companies asking for JavaScript knowledge for QA. So my questions are:

  1. What is the use of JavaScript for QA?
  2. If JavaScript is used for testing, what kind of things are tested using JavaScript?
  • 7
    It is not obvious if your question is focused only on developers of automated UI tests for web based applications, or you are interested also with skills for manual testers who test web apps (and might build tools to automate some parts of testing, but not fully automated tests), and/or non-web-based applications. In each niche, different skills are needed. – P.M Apr 10 at 14:59
  • 4
    @PeterMasiar Joe isn't asking for advice on what will be most profitable to spend his time on, Joe is asking why these companies might be looking for QA people with javascript knowledge.. It seems you are asking him to answer his own question by listing the purposes js might be used. – Mr.Mindor Apr 10 at 18:31
  • 4
    Dear future reader: as you can see, 80% of readers assume that "QA" == "developer of automated UI tests for a web based app". Which might be correct for 80% of the cases, and these hordes are overpowering more cautions QA users like me, who want to add some nuance as found in real life. Provided answers are not wrong, they just assume there is no QA jobs except UI tests for web apps (and yes, those jobs would use JS/protractor etc, as I mention in my answer). – P.M Apr 10 at 18:57
  • 5
    @PeterMasiar I don't think any of the answers are necessarily assuming that. They are just answering the question as posed... Q:"Why might company be asking for javascript?" A: "The company might use javascript for X, Y, or Z." I don't see any answers that say "javascript is only used for x, y or z." Nobody is assuming other types of QA jobs don't exist, but the QA jobs this question asks about apparently use js for something. If they didn't use it, it quite likely wouldn't be listed as a requirement. – Mr.Mindor Apr 10 at 19:14
  • 4
    @PeterMasiar I'm not talking about automation. I'm talking about using a website, pressing F12, and going to town. – corsiKa Apr 11 at 16:51

10 Answers 10

up vote 9 down vote accepted

To answer your questions:

1: What is the use of JavaScript for QA?

UI Testing of web pages, when the UI is written using JS-based UI front-end frameworks like Angular and friends as is the current standard (there are many: Short and Brutal Lifecycle of JavaScript Frameworks)

2: If JavaScript is used for testing, what kind of things are tested using JavaScript?

The front-end of a web-based app. And even for web-based apps, whose UI is written using one of the JS frameworks, JS in not the only (and often not the best) language to write tests. And the app backend is most likely written in a different language, not JS.


More detailed answer, to things you haven't asked, but should:

TL;DR: JavaScript is ubiquitous (especially for the frond-end), is here to stay for a long time, and good to know if you like it, but is not strictly necessary (beyond learning the trivial basics), because other languages (like Python) are a better fit IMHO (give you a better return on your time invested in mastering them) for most of use cases beyond UI (like API testing, custom DevOps tools etc).


Not all testers are writing automated tests for a living.

A manual tester has little or no immediate need to learn any programming language. Programming induces specific thinking to a person, so it is beneficial if some manual testers do not think as a programmer would, so they can find bugs which programming-thinking person will miss.

But many learn "some" programming anyway, mhd's answer explains why (even if I disagree that every manual tester needs to learn basic programming).

Learning SQL helps with investigating data in database-related issues. No need to be an expert, being able to grok and tweak SQL queries provided by expert developers is enough.

Learning a simple language like Python allows a tester to write simple tools manipulating data, searching for patterns etc.

Learning JavaScript is a bigger decision. It would be useful ONLY if the tester works/is interested in testing front-end/UI parts of an application written in some JS framework.

Recently we had several questions related to the test pyramid:

Consensus is that

  • UI tests (in JS) should be only a very small part of your overall test (about 4%),
  • about 16% test should be for the API (written in JS, other scripting language like Python, or possibly even in a core app language), and
  • 80% unit tests (written in the web application's core language, which in most cases is NOT JS).

We (in our company) have many UI tests in Python/webdriver, are currently considering transition to JS/protractor, and it is a steep and long learning curve. Because you need to learn:

  • new language, designed for small code snippets by inexperienced programmers, used way beyond it's original scope, and full of quirks and traps. Even according to experts who like JS there are problematic features of JavaScript that are not easily avoided - and you "must be aware of these things and be prepared to cope".
  • new IDE (seems that everyone writes JS tests in Visual Studio Code), where everything is configured by JavaScript literals
  • new toolchanin (node.js) which is also written in JS. Good example of dogfooding, but it requires the total commitment.
  • language itself is changing, abandoning the "awful" parts mentioning above (ECMAScript versions, "use strict;", TypeScript).

Many of these complications (and strategies to handle them) are important for front-end developers (because they do not have control which variety of JS is installed on users device - and not even which browser version from which vendor, each with own bugs in JS implementation), but they are unnecessary baggage for a QA tester with substantially better control of the environment.

I am not sure if switching to writing UI and API tests in JS is worth the effort. From a test developer's POV, dealing with expected conditions (synchronous) is much easier than asynchronous promises in JS.

So, in my opinion, learning JS might be a valuable addition to an automated tester's skillset (for reasons listed in answer by Alexey R., but also might not be necessary if the automated tester is expert in another language like Python, and furthermore tests for the middle level of the test pyramid (API/services level) can be more productively written and maintained in Python than in JS. For UI tests, JS is almost required, for the API/services layer, not so much.

We are currently considering writing some basic UI tests in JS, but maintaining another set of UI tests in Python, which we plan to use also for API/services tests and which are in our core app language (Python, as are most of the tools for DevOps). The reason is productivity: our devs are more productive in Python than JS (write more reliable and maintainable code). We have few JS experts but for most other devs, to attain their current Python level competency in JS will take a year or two (or more, as our main app and DevOps language remains Python). This might change as we gain more experience in JS for production-level deployment, and JS is becoming more strict and reliable ("use strict;" TypeScript etc).

But also some of our Python dev experts are not eager to invest many years of life mastering JS, and might switch jobs to keep improving Python skills instead of being forced too deep into JS. In my experience, while JS might be an important language for a UI automation tester, Python is a better language for file manipulation, text parsing and building command-line tools (DevOps tools), has fewer hidden traps than JS, and also is easier to learn as a first language.

So while learning basics of JS is easy and fun, (if you have experts handing the complexities), and you should do it, including learning about the quirks and traps, but mastering JS with all its complexities might not be needed if you are competent QA engineer in other languages.

I think that the strongest argument for learning JavaScript for QA is Appium (for testing apps for iOS and Android, in JS) and how important it is for your career. But for some reason, it was not mentioned in any other answers.

  • 5
    How does your experience/opinion that Python and SQL are better tools for a QA engineer to have than javascript help to answer the question of "Why would companies list javascript as a requirement for a QA engineer?" – Mr.Mindor Apr 10 at 19:00
  • @Mr.Mindor - But the Question is: Why should a software QA engineer need to learn JavaScript? And the summary of my answer is (see above): while JS is beneficial in a wide niche (automated UI tests for web base app, as I answered), JS is irrelevant for other QA tasks. And I also claim that UI tests in JS is a (necessary, but) fad, better (more stable) tests are on service/API layer, which might benefit from other languages than JS. – P.M Apr 10 at 19:14
  • 4
    ...In response to the first question it may be reasonable to suggest other things might help QA peeps more in general, but in response to the second question, that other languages are used for other things is irrelevant. They are not asking what might Python be used for or SQL. – Mr.Mindor Apr 10 at 19:27
  • 3
    I've read it several times. I always reread at least once before asking for clarification. It is clear you are reading a lot more into the question than I am. It is like if someone asked "Why do car makers paint cars?" and you answered "they paint cars to prevent rust, but not all factory workers work on painting cars, some put together the seats, and others do wiring so knowing how to paint cars might not be the most important thing for an autoworker." – Mr.Mindor Apr 10 at 19:49
  • 4
    @PeterMasiar Using Javascript for testing is not a fad by any stretch of the imagination. I have written unit, integration, and end to end tests for several different companies at this point. All using Javascript. While I will agree that automated UI tests using JS may be inherently flaky, I would also argue that those same tests would be inherently flaky no matter what language or platform you are using. That being said, there is nothing unstable about writing unit or integration tests for Angular or React projects using Javascript. If done correctly, they are reliable 100% of the time. – tehbeardedone Apr 10 at 21:47

Well, apart from the obvious answer like "QA engineer should learn JavaScript to be able to use TA frameworks which work with JavaScript" I would say that a QA engineer should learn JS because knowing even basic aspects of how JS works or how it is applied to Web development brings you to a new level of defect hunting.

Knowing basics of JS will let you:

  • understand how dynamic and asynchronous UI is built
  • troubleshoot different problematic cases when something is working in the different way than you expect and filter out the cases which are NaB
  • catch the potential defects when everything is working fine but there are some error messages in JS console
  • help your dev team to resolve the root-causes of your defects and gain your professional reputation
  • inject some JS which would help you to test the app (e.g. putting some valuable info on the current client state to the browser's status bar or alert )
  • test for vulnerabilities like XSS
  • ...and many other funny things...
  • 3
    Software QA is not limited to web development. It's pretty much useless to learn JavaScript if the product doesn't rely on web technologies. – Florent B. Apr 10 at 14:08
  • 12
    Sorry guys I cant understand your point. I totally agree that JS is useful for web in general. I just answered the question that had been stated in the form it had been stated. Not about SQL and not about Python, but about Javascript. – Alexey R. Apr 10 at 15:01
  • 14
    @PeterMasiar: The question is framed in the context of job advertisements that ask for JS expertise. Presumably, the companies which advertise in such a way use JavaScript for something. Or, maybe, whoever wrote the job ad has no clue. – Jörg W Mittag Apr 10 at 15:14
  • 11
    I'm really confused by the majority of the discussion on this answer. The question was specifically about why a QA Engineer would need to know Javascript. Alexey answered the question perfectly. – tehbeardedone Apr 10 at 15:41
  • 8
    @Florent B. I wholly disagree. The question was specifically about why employers would be looking for a QA Engineer with JS knowledge. The answer addresses the question as it was asked. It doesn't assume or suggest anything. – tehbeardedone Apr 10 at 17:22

One of the reasons would be to write end-to-end automated tests using Protractor. Protractor is an end-to-end test framework for Angular and AngularJS applications, where you write tests in javascript. It is designed to work better with angular applications better than pure Selenium.

Additionally, knowledge of a programming language used in a project may be helpful even for a QA engineer that tests manually.

The more you learn about the technologies your developers use, the better you will be at your job, and the more valuable you will be. In other words, even if you never write a line a JavaScript for your job, you will still be in a better position to test someone else’s JavaScript.

  • But id OP will never write a line in JS, would not be time spend on learning JS better spent on something else, which OP would use? Life is short and time is precious, focus on learning useful things. Maybe learning SQL, or Python for text parsing/file manipulation, mastering Jenkins or Elastic Search would be time spend better than in JS? – P.M Apr 10 at 17:36
  • 8
    Getting a law degree might be more lucrative too, but the Op asked about JavaScript. – user246 Apr 11 at 3:21

I think the basic question should be "Why a software QA engineer should learn programming".

Which programming language to learn is not important, it can always change. As a QA Engineer, you can work on projects from several platforms (web frontend, web backend, mobile, desktop, IoT devices etc).

A QA Engineer could be required to:

  • perform only manual testing
  • perform only automated testing
  • perform manual and automated testing

Why would programming help a manual QA Engineer:

  • will learn how to build things -> will know better how to break things (similar to security testing field)
  • will logically learn how things work and why they work in a specific way -> create more complex and/or efficient test scenarios
  • will learn how to debug correctly and find the root cause of a issue -> very helpful when reporting an issue, and can save a lot of time on developer's side
  • will learn how to solve problems, not only to find them -> when reporting an issue, expected results will be more accurate and can even open new ideas or functionalities

Programming is just a part of the QA Engineer role, but in my opinion, an important one. It's also not as complex as a developer's work, so I think that every QA can learn how to program at a basic level and bring more value to the project.

With the popularity of JS Frameworks like Angular, React, Nodejs, there has been a surge in the testing frameworks using JS- be it an E2E framework like Protractor, Nightwatch, Cypress or API testing frameworks like Chakram etc.

I agree with Peter's answer and I think it puts a lot of valid points.

A frequent argument for the surge of these JS frameworks and need to learn JS is that there are a lot of advantages if your automation framework is developed using the same tech stack that your UI/API uses. There is a good amount of valid points and arguments given in this excellent post.

One of the main reasons for choosing a Javascript test suite over another language is because your development stack is in Javascript. Having one programming language across development and QA means that there will be less communication barriers and the QA department will introduce less new tools. Also, it opens the possibility that development and QA will be able to share the same codebase.

And as mentioned in other responses, Javascript is a popular language and much of the web is built upon it. Learning Javascript will help you understand how the application is built.

// The Why

Javascript is gradually becoming the required language for a QA Engineer mainly due to the dominance of its ecosystem in the modern development frameworks and thus in the software development world.

// Front End

Regarding the UI/E2E Testing, the use of Javascript gives you the advantage to better collaborate with the Front End team since you will have JS as a common ground. You will be able to peek and even contribute to their code base in the long run if you wish so (code reviews, unit tests, etc).

// Back End

With the rise of NodeJS Javascript presence in the back-end is increasing, giving you an additional 'hook' to understand it, interact with it, and eventually test it in a more effective way.

// The Value

But besides using a language that's closer to the one used for developing the product-in-test, I believe that -compared to other used languages like Java- Javascript gives you the opportunity to learn & invest time within its ecosystem which is continuously growing & expanding, and make the transition to a 'pure' development job (either front-end or back-end) more smooth. Even if you never plan to make such transition, it's a strong skill to possess nowadays.

P.S. You can find a neat list with JS automation frameworks & tools here.

If you hold a cat by the tail, you learn things that cannot be learned in any other way.

-Mark Twain

Learning JavaScript is no different. If you are testing front-end JS frameworks like AngularJS, Angular, React, Vue etc. and if the full or majority of the stack in your project team is on JavaScript, then learning JavaScript makes sense even though it is tricky and bizarre as a language to learn.

It is always advantageous to think in terms of how learning a skill would be a unique value-add to one's existing skill set and the current and future projects.

What is the use of JavaScript for QA?

  • Writing automated tests, for example with Webdriver.js
  • Understanding how modern web applications work

If JavaScript is used for testing, what kind of things are tested using JavaScript?

Most testings tools are programmable with JavaScript, some examples:

Next to that the Node.JS runtime environment is the fastests growing and largest package registry in the world, with which you can quickly build handy command-line tools, possibly to automate your testing efforts (e.g. data generation or chain stuff).

You can do and build everything with JavaScript, it is becoming the bread and butter of the engineering world.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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