I already set-up the Selenium webdriver framework to handle AngularJS application. But, I am using lot of wait and Thread.sleep() which is making my script fragile.
I heard about ngWebdriver and Protractor which are good to execute automation for AngularJS Application.
I have knowledge on Java , but no idea about JavaScript.
Should I use ngWebDriver or learn JavaScript to implement Protractor?
I think ngWebDriver is capable of handling the issues you are facing. The biggest problem of WebDriver2.0 is that it could not handle the asynchronous element calls and that's where the ngWebDriver comes into the picture and code new NgWebDriver(driver).waitForAngularRequestsToFinish();
will be there to fulfill your need.
Whereas, If you feel comfortable with the automation scripting on java script then the Protractor will be the only best choice. But, also you shall consider the other points like the IDE for java scripting Notepad or NP++ will not be the good option as it will not support the key senses and some best IDEs are paid too (like webstorm) whereas you can do some simple hacks and use eclipse as the Editor but before that you should also consider the scope of protractor as you can see that the rapid growth in java script frameworks. the client side JS frameworks are growing faster than ever. you'll have to consider your career perspective too as now days the ReactJS is growing faster than the angular JS and then again you'll have to switch on webdriver (while it depends on the project and it's requirement) in near future.
AngularJS - Launched in (2010) - Git-Hub stars 48874 && ReactJS - launched in (2013) but got 41283 Git Hub stars
conclusion: better would be to go with ngWebDriver, give it a chance and see if it fullfils your requirement then stick with it as you have already designed the framework or else there is no other option than protractor.
Protractor beginners tutorial: https://www.youtube.com/watch?v=NV1J3oylMjU&list=PLhjFPlDbRmbtSGNlNGGgF1ZjFjWPK6AaO
Well, you would have to learn some JavaScript for Protractor. But I would suggest learning Protractor considering it was made by the Angular team at Google specifically for Angular testing (although it can be used for non-Angular as well).
Protractor will eliminate all of those waits and sleeps because it uses implicit waits and fires off tests after Angular is done synchronizing with the page. You'll have more support, documentation, and information surrounding the Protractor framework as well.
If you are using Selenium with Java already then you would not be able to use protractor as it will only work with JavaScript. Just add ngWebDriver library to your project and this will help you within the current framework and can handle angular application easily.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With