Protractor Tutorial 5 – Introduction & Installation of NodeJS

NodeJS official website defines it as:-

Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Let me make it little simple for you.

NodeJS is an open source JavaScript based framework which is dynamic, cross-platform , asynchronous(Non-blocking APIs) and highly scalable runtime environment. It was developed by Ryan Dahl in 2009. It is used to run JavaScript code at server side. It means you can run JavaScript code outside a browser using NodeJS environment. It helps to create dynamic web pages.

NodeJS comes with the package manager called NPM (Node Package Manager) which makes it easier for programmers to publish and share source code of Node.js libraries. We can also install, uninstall and update any NodeJS libraries in easy ways using commands.

Why does Protractor need NodeJS?

Protractor is built as a wrapper on WebDriverJS which is JavaScript binding for WebDriver API. WebDriverJS uses NodeJS as a running environment to run JavaScript files. So indirectly Protractor also requires NodeJS. We can say Protractor is a NodeJS program.

If you want to use Selenium with Java binding, you need to install Java first. Same way here since Protractor is a NodeJS program, you need to install NodeJS first.

Installation of NodeJS:-

It is as simple as any normal software installation.

  1. Navigate to NodeJS official website.
  2. It will automatically detect your system details and will show NodeJS installer to download.

3. Download LTS version ( Long Time Support). For windows it will download a .msi file.

4. Double click on it and install it by following through screens.

5. Once you are done, run below command in terminal.

node -v or node –version

Above output verifies that you have successfully installed NodeJS. 

More on Protractor in upcoming posts. Stay tuned and keep learning with me.

#ThanksForReading

Leave a Reply

Your email address will not be published. Required fields are marked *