Any advantage or Disadvantage Protractor Vs Selenium?

ChanGan picture ChanGan · Apr 29, 2016 · Viewed 36.1k times · Source

I am currently working on the WebApp which has Lot of Angular js... We started with Selenium WebDriver and the scripts works well scratch codes... But I am suggested that we need to use protractor instead of Selenium WebDriver. As far as both do the same job for me. The ONLY difference I found is that I don't want to wait explicitly to load the webpage..

Is there any other advantage or disadvantage in Protractor Vs Selenium WebDriver?

Answer

eduliant picture eduliant · Apr 29, 2016

Hi we can have a discussion over it but as far as selenium vs protractor goes:

SELENIUM

  1. Works great even if it's angular JS website, only we have to deal with synchronization issue. If you can handle then no disadvantage.
  2. Selenium is very rich in automation, i.e, it's in the market for years and very much evolved and its API is almost stable.
  3. It's in fact a defacto tool in the open source market for browser automation.
  4. You can work with selenium in almost every popular language.

PROTRACTOR

  1. Is marketed as angular based automation tool. But when you would look at its core it's wrapper for webdriver JS. Hence it does not uncover any new vertical in browser automation.
  2. Yes it has certain advantage in case of angular specific locator strategy. It provides more option to work with Angular directives (i.e angular specific locator strategy).
  3. It's only available for only one client (language) i.e for JavaScript only. So to work with it you must know JavaScript.
  4. New in the market although its based on the webdriverJs.

So it totally depends upon your project requirement and team knowledge which tool you want to use. It will not be good to say which has what advantage over other. Both tools are here to help us and make browser automation flawless. Hope this helps.