Blog

Uncategorized

Protractor JAVA: Writing a simple script using Jprotractor jar file

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 drivernew ChromeDriver();
    ·         Create an object to NgWebdriver a below:
    NgWebDriver nDrivernew 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
 
error: Content is protected !!
Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare