Thursday, 21 April 2016

Getting started with Protractor


Note| 
 
Text in Blue [#PYTHON], Rose [#PROTRACTOR], Red [#RUBY] and Orange [#JAVA] can be edited or mentioned important for the entire blog. All the posts are practically done by me.


Getting started with Protractor

1| Create a folder for new project.
2| Open Terminal/cmd_prompt and navigate project location.
3| Download protractor through terminal (make sure you have installed nodejs in your machine before executing the following command)

project-wise installation
npm install protractor

or
global installation
npm install -g protractor

4| And update the selenium-standalone-server.jar file after protractor installation.

project-wise updation
node_modules/protractor/bin/webdriver-manager update

or
global updation
webdriver-manager update

This will update the existing selenium server and ChromeDriver under node_modules/protractor/selenium/selenium-server-standalone-2.xx.x.jar



To update the selenium server alone, enter the following command,
webdriver-manager update --standalone

5| Now, create a spec file using Jasmine unit testing framework #sample

6| And create the Protractor configuration file, protractor-conf.js for execution #sample

7| To run the spec file, you need to start selenium-server first,

project-wise
node_modules/protractor/bin/webdriver-manager start

or
global
webdriver-manager start

8| Let's run the first protractor project now,

project-wise

node_modules/protractor/bin/protractor protractor-conf.js

or
global
protractor protractor-conf.js


Note: For more info. download my sample project from Github Link