Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I have come to know that Selenium is the father of UI testing.

Now my question is why then Angular team has developed Protractor. Can't the same job (that Protractor does) be done with Selenium for AngularJS based web applications?

Further, people are talking about Nightwatch.js too. So why there are so many E2E testing libraries/frameworks like Protracor or Nightwatch.

share|improve this question
    
Protractor is not a replacement of Selenium webdriver but relies on it to run tests atop. More info: angular.github.io/protractor/#/server-setup – codef0rmer Sep 25 '14 at 9:55
    
@codef0rmer my question is why do you need Protractor in the first place if Selenium can do the same work. – Pulak Kanti Bhattacharyya Sep 25 '14 at 10:16
1  
I shared the link because they have pretty much explained what role protractor plays in the setup. More info: angular.github.io/protractor/#/infrastructure – codef0rmer Sep 26 '14 at 12:43
1  
Is there anyone who is using Nightwatch.js? – Pulak Kanti Bhattacharyya Sep 27 '14 at 17:23

Protractor combines powerful tools and technologies such as NodeJS, Selenium, webDriver, Jasmine, Cucumber and Mocha. Has a bunch of customizations from Selenium to easily create tests for AngularJS applications. Speeds up your testing as it avoids the need for a lot of “sleeps” and “waits” in your tests, as it optimizes sleep and wait times. Allows tests to be organized based on Jasmine, thus allowing you to write both unit and functional tests on Jasmine. It runs on real browsers and headless browsers...

You can find all these information here => http://www.thoughtworks.com/insights/blog/testing-angularjs-apps-protractor.

share|improve this answer

Protractor also provides you to wait for scope changes using protractor.waitForAngular() which I think may or may not be implemented using Selenium. You'll still have to bang around your head in order simulate the same feature using selenium.

My opinion

If you just want to do UI testing and not interested in listening for scope changes or any angular specific events, you can go ahead with selenium. But it's a HUGE advantage using Protractor for e2e tests for Angular.

share|improve this answer

This answer can get very complicated very fast. In basic terms some E2E, UAT run faster than others and hence if you are into CI and CD it makes a big difference to your deployment pipeline.

Selenium usually heavier option than karma or protractor, and used for UAT rather than commit/staging tests.

I hope this make sense.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.