Get Started With Automation Testing Using Jasmine And Protractor

Intro

For many of us, web technologies are the first gateways to wet our feet into code development. Web applications are, in general, any client-server architecture based software solution with the user accessing the services through a web browser. Any website that you visit today can be termed a web application.

Solution

The different modules of these applications are generally built in any of the web languages like HTML, CSS, Javascript and its myriad derivatives. For testing these applications the Selenium framework is used widely. Even if you hear of some other frameworks, chances are that they are a wrapper around the Selenium WebDriver.

Selenium Logo
Selenium

For setting up your system to perform selenium based web application tests, you can choose any language of your choice from the languages that are supported by selenium. The procedure to set up a system and get it up and running may differ depending on the language you choose to use.

We will start with the Protractor framework, thus overcoming the flaws of the Selenium-through-Java implementation. It is a framework suitable for testing web applications built using AngularJS. We will be using the Visual Studio Code editor along with the AngularJS based Protractor framework, which is but a wrapper around the Selenium WebDriver.

Protractor Framework Logo
Protractor Framework

Setting it up

But for all this integration to work, we will need the Node.js framework set up on our system. Download and install Node.js suitable for your system. To check whether it is successfully installed or not, just open any terminal or console window and type

node --version

It should return with something like this

Node Version
Node Version

Now we will use the Node Package Manager (npm) to install Protractor.

npm install -g protractor

The -g attribute installs the Protractor framework globally.  After the installation is complete, check if it is successfully installed.

protractor --version

It should return the version number of the Protractor framework installed.

Protractor Version
Protractor Version

This would also install the WebDriver Manager which is the wrapper over Selenium’s WebDriver that we have been talking about.

Next we would need somewhere to write our tests in. Download the Visual Studio Code editor.

And yes, that was as simple as that! Your system is ready to execute tests on Web Applications. In our next post, we will deal with how to write our very first protractor based test.

Stay tuned. Adios!


For more, head over to our blogs section.

Share your love
Punit Goswami
Punit Goswami
Articles: 4

Leave a Reply

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