Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RobotFramework vs Protractor for AngularJS Testing [closed]

I am trying to finalize a tool for testing an AngularJS based web portal.

I have explored Protractor and was quite sure of using it for AngularJS tests until someone from the team came up with a suggestion of using Robot Framework.

So, Now I need to compare Protractor with Robot Framework.

Protractor has an advantage of having customizations available for AngularJS. However, I would agree that the learning curve is not too smooth because of the terminology and concepts (Promises and Control Flow) used.

Now I need to understand how good is Robot Framework for AngularJS testing. Is there anything one would miss regarding Protractor if switched to Robot Framework? Please provide your valuable inputs for the same.

  1. Learning curve
  2. IDEs available
  3. Ease of automating AngularJS UI tests
  4. Any other relevant points you feel are important!
like image 685
Sakshi Singla Avatar asked Jan 14 '15 08:01

Sakshi Singla


People also ask

Is a protractor an open source?

Protractor is an open-source automation testing framework that is written using NodeJS. It offers combined end to end testing for web applications that are built using AngularJS. It supports both Angular and Non-Angular applications.

Which tools are used for end to end testing in Angular?

End-to-end testing (E2E) of Angular applications is performed using the Protractor testing framework, which is created by the Angular team themselves. Protractor can perform end to end tests on Angular applications that are running in a real browser by interacting with it, similar to that of an end-user.

Is protractor only for AngularJS?

js etc. The Protractor testing tool is an end to end behavior-driven testing framework designed keeping Angular JS applications in mind. Even though that might sound like Protractor won't work with non-angular JS applications, it does. It works with both Angular and non-Angular JS applications equally well.

Why protractor is used for Angular applications?

Protractor supports Angular-specific locator strategies, which allows you to test Angular-specific elements without any setup effort on your part.


2 Answers

Being in the middle of exactly such debate right now, I can tell you a few things:

  1. AngularJS has a "loading" issue. Protractor solves that issue by giving you the function WaitForAngularToFinish. You get other things as well from Protractor such as ByRepeatNG

  2. Automating UI by Robot Framework is done using Selenium 2, and the robot library doesn't contain Angular Specific code (WaitForAngularToFinish)


For now we're trying the Robot Framework way

We've solved the issue in Robot by tapping into the Java Library ngWebDriver

We've created a new robot library based on ngWebDriver with autowiring (to get the Selenium2 driver from the robot library) that gives the same functionality as Protractor.

Pros to going the robot way:

  1. Robot Framwork gives you the ability to do everything, Not just UI. So you can prepare the test environment exactly like you want it (much harder to do in Protractor)

  2. English. The ability to let non-coders write tests (We're using Gherkin notation).

  3. Stability (everything about NPM for example, is inherently unstable)

Cons to going the robot way:

  1. Harder for the Javascript people to write underlying code for the tests (since some of the underlying code will be in Java)

  2. Simplicity

Regarding you other questions:

  1. Learning Curve - easy on both Robot and Protractor
  2. IDEs available - I'm using a plugin for IntelliJ for Robot Framework. The enterprise version of IntelliJ (which costs a lot of money) works quite well with Protractor as an IDE.
  3. Ease of automating AngularJS UI tests - Once you have Angular keywords in Robot, you're good. Before that, very hard.
like image 126
Uri Shtand Avatar answered Sep 18 '22 18:09

Uri Shtand


Robot Framework is quite lightweight and learning curve is quite fast from what I could see in the different places I used it. In terms of IDEs, there are plugin for most of them (I would not recommend using RIDE if you already have a favorite IDE).

To answer question 3) and 4) I would say that it all depends on your organisation and culture. If the end-2-end tests are going to be written by the Web App Angular developer, then probably better sticking with Protractor as this is all in the JavaScript ecosystem. But if you have a separate team of QA who is in charge of testing, they might indeed find some of the protractor/javascript to be complex/heavyweight for what they have to do. With QA that are a bit less hard-core-coder than developers, I find that Python is more appropriate and easy. And in that case, Robot Framework is a very good choice.

like image 35
Laurent Bristiel Avatar answered Sep 18 '22 18:09

Laurent Bristiel