Protractor Setup with Eclipse

Protractor end to end testing for AngularJS -Protractor Setup with Eclipse

Protractor is an end-to-end test framework for AngularJS applications. Protractor is a Node.js program that supports the Jasmine and Mocha test frameworks.

Selenium is a browser automation framework. Selenium includes the Selenium Server, the WebDriver APIs, and the WebDriver browser drivers.

Install NodeJS

  • Lets start Protractor Setup with Eclipse
  • Download the Node.js .msi Installer click here
  • Verify Nodejs is installed by writing command in comman line as node –version

Setting Up Protractor

  • During Protractor Setup with Eclipse After installing Nodejs you have to install Protractor NPM package.
  • Protractor is a Node.js program. To run Protractor, you will need to have Node.js installed.
  • Type in command line npm install -g protractor
  • Verify Protractor is installed correctly with command protractor –version.
  • Protractor installation includes protractor and webdriver-manager command line tool.
  • The webdriver-manager is a helper tool to easily get an instance of a Selenium Server running.
  • You also have to update webdriver manager for that type in command line webdriver-manager update
  • After this to start webdriver manager you have to type command webdriver-manager start
  • This will start up a Selenium Server and will output a bunch of info logs.
  • You can see information about the status of the server by typing http://localhost:4444 into the browser url.

Configuring Eclipse to run Protractor

  • First we will have to install below plugins from eclipse Marketplace
  • Anjularjs plugin
  • Batch Editor plugin
  • Tern eclipse IDE plugin
  • After installing Anjularjs plugin create an Javascript project inside eclipse.
  • To create Javascript project go to  FIle -> New ->others ->JavaScript ->JavaScript Project.
  • After creating Javascript project add conf.js and example_spec.js files to the project.
  • You will find the conf.js and example_spec.js files at path C:\ Users \ Admin\ AppData \Roaming \ npm \ node_modules \ protractor \ example
  • After copying conf.js and example_spec.js files.
  • Right click on project -> configure ->click on convert to tern Project. As shown below.
  • After clicking on convert to tern project you will get pop up window as shown on left image
  • Select the options AnjularJs , Jasmine and Protractor from the list and click on OK button after  this our project will get converted into tern project.
  • To run the project we need to make a bat file 

Creating bat file to Run project

  • To create bat file Right click on Project ->New ->file-> give file name as ProtractorRunner.bat ->Click Finish
  •  Inside bat file write the one line of code ” protractor conf.js “
  • To run bat file we need to make below configurations
  • Select click ProtractorRunner.bat file  and click on External Tools Configurations as highlighted below
  • In main tab click on Browse Workspace and give the path of ProtractorRunner.bat
  • Similarly in main tab for Working directory  click on Browse Workspace and select the project folder as shown in below image.
  • After this click on run button after this program should run successfully if you face any issue let me know in comment section.
  •  Protractor Setup with Eclipse is completed here

Part 1

Protractor for AnjularJS (Part-1 ) Protractor Setup with Eclipse

Part 2

Protractor for AnjularJS (Part-2 ) | Protractor Setup with Eclipse

Did we left something?

Comment down below and share your knowledge with others too , Thanks.

Or Please give your valuable feedback to us...


Author: Saad Mansuri

7 thoughts on “Protractor Setup with Eclipse

  1. When i am trying to execute protractor script in chrome browser it is displaying below error message
    session not created: This version of ChromeDriver only supports Chrome version 74
    I am using ‘Chrome’ browser of version :Version 73.0.3683.86 (Official Build) (64-bit)

  2. Now below error message is displaying , Error while waiting for Protractor to sync with the page: “both angularJS testability and angular testability are undefined.

  3. Hi Saad,

    What eclipse version are you using on this tutorial? because when I’m trying to install the external plugins ( the Tern Eclipse to be specific), it says that my current eclipse (2019-06 (4.12.0)) is not supporting that plugin anymore.

Leave a Reply

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