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 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