Showing posts with label installation of protractor. Show all posts
Showing posts with label installation of protractor. Show all posts

Tuesday, 25 July 2017

Protractor JAVA: Writing a simple script using Jprotractor jar file

Hi All,

Hope you are doing good.

In this blog i would like to walk through to write a simple program in Java to calculate sum of  2 numbers in Angular application: 

  • ·         Create a new project in eclipse editor
  • ·         Add Selenium java client drivers to your project
  • ·         Add above created Jprotractor jar file to your project
  • ·         Create a package and create  a class
  • ·         Write a command to launch chrome driver as below: ·          

  • System.setProperty("webdriver.chrome.driver", "C:\\Users\\uname\\Downloads\\chromedriver_win32\\chromedriver.exe");
            WebDriver driver= new ChromeDriver();
    ·         Create an object to NgWebdriver a below:
    NgWebDriver nDriver= new NgWebDriver(driver);
    ·         Write webdriver commands using nDriver as shown in below code snippet: 

NgBy.Modal, NgBy.buttonText(): we have 10-12 supported methods are there which you can get detailed information from the below link only https://github.com/sergueik/jProtractor


We will see how to write few more programs using this jar file in next tutorial



Thursday, 23 March 2017

Protractor : Installation of Protractor to your Machine

Protractor Installation:
***Use npm to install protractor globally***
·         Open the command prompt
·         Enter npm install –g Protractor


·         click enter button
·         It will take couple of minutes to install
·         It will install two command line tools 1) protractor and 2) webdriver-manager.
·         Open command prompt and enter protractor --version to make sure it's working.
·         The ”webdriver-manager”  is a helper tool to easily get an instance of a Selenium Server running.
What is the use of webdriver-manager:
The web driver manager is used for running the tests against the angular web application in a specific browser. After Protractor is installed, the web driver manager needs to be updated to the latest version
·         Open the command prompt and enter below command and click enter button
webdriver-manager update



·         Once Protractor is used to run any test, the web driver will automatically load and run the test in the relevant browser. To start the web driver manager, the following command needs to be executed from the command prompt.
·         Now start up a server with:
webdriver-manager start
·         The above will start up a Selenium Server and will output a bunch of info logs.
·          Your Protractor test will send requests to this server to control a local browser. Leave this server running.
·          You can see information about the status of the server at http://localhost:4444/wd/hub.