which is the best test automation framework for automating AngularJs Single Page application? - selenium-webdriver

i need to automate the angularjs single page application, so which stack of framework i should go with? is it Protractor + Jasmine + cucumber +selenium Framework or Ngwebdriver for selenium. Please suggest. ngwebdriver or protractor?

Protractor is an end-to-end test framework for Angular and AngularJS applications. Protractor runs tests against your application running in a real browser, interacting with it as a user would.
Refer https://www.protractortest.org/#/frameworks for choosing your framework.
Hope it helps you.

I would suggest to try QAF with Java or BDD. You can integrate ngWebDriver with QAF. It can be used for web, mobile and webservices.

Related

d3 Automation Testing

I need to test some d3 based Angular components and had thought to use Selenium IDE or Kantu, but it seems that these tools cannot record interactions with SVG elements. Are there any tools that would allow me test in this way? Or will I need to rethink the problem and use a different type of testing?
There is a tool specifically made for UI testing of angular.js pages. It's called protractor . In this, test scripts have to be written in Javascript. Protractor is for end-to-end testing.
If you are going to do unit testing , then the gold standard for unit testing angular code is Karma. Karma was created and is maintained by the core Angular team and provides many utilities that make it easy to test angular apps.
A combination of both protractor and karma can completely cover an angular app functionality.

Is it possible to run angular js app directly on mobile

i just want to know that is it possible to run angularjs app on mobile directly means without using web browser??
I search google and it seems i can't but my client want to do that.
you could also use Ionic Framework (ionicframework.com) for this as it is heavily using Angular and encapsulating everything in real mobile apps that are capable of being deployed via App Stores (Play Store, iTunes, ...).
Best regards,
Steviee
You can use Cordova Framework Which generates mobile application in android and ios also for that you can refer -https://cordova.apache.org/docs/en/latest/
Follow this documentation step and you get all files with proper structure in that you can write your application code.
Try angular bundler for cordova.
abc framework - https://github.com/thruthesky/abcframework which gives you a great convenient building mobile apps using Angular.
abc is Angular Bundler for Cordova which helps you building mobile apps with Angular.

Can you run a standalone angularJS web application in backbase 5.5.1 (newest)?

We are developing a standalone angularJS web application and need to make it work in the newest backbase portal.
We have no idea if this is even possible?!
Thanks in advance!
Backbase widgets work standalone and follow the W3C specifications. However, if you are writing a SPA as a whole, you are not getting the true benefits of widgets.
You should separate your application into widgets, in other words, mini angular applications.

Can angularjs apps be automated with selenium? if yes, why should we use protractor?

I know that we can automate AngularJs apps with Selenium. But we have a separate E2E testing framework that is Protractor for AngularJs apps automation.
Can anyone help me understand why we should use Protractor? Why not Selenium?
Not sure I understand your question. Am I right to assume you'd rather use Selenium - but want to understand what you're missing?
Well - Selenium provides means to automate web browsers - and thus used for automated e2e tests. Selenium API has implementations in several major programming languages - allowing you to write your tests in Java, C#, python, ruby, JavaScript and more.
If you already have a selenium-based e2e testing framework in place - you can use it also for AngularJS web-apps. You can also write the necessary JavaScript scripts that, once ran using the webdriver - will let you do all that Protractor does - but you'll have to do it yourself (just borrow from Protractor source code).
Why is it doable? Because Protractor basically took the JavaScript implementation of Selenium Webdriver and wrapped it in a way that makes your life a bit easier when testing Angular JS web apps.
You can see specific explanations in this old post of mine:
http://testautomation.applitools.com/post/94994807787/protractor-vs-selenium-which-is-easier
I'd say that if you:
1. want to write your test code in JavaScript
2. are focused on mainly Angular JS apps
You might want to consider using Protractor. Again - no magic there. Everything they did is there in their source code - so you can just take your picks if you'd rather stick with selenium.
protractor is an end-to-end browser automation testing framework that works through WebDriverJs which is a javascript selenium webdriver.
Quote from How it works? documentation page:
Selenium is a browser automation framework. Selenium includes the
Selenium Server, the WebDriver APIs, and the WebDriver browser
drivers.
Protractor works in conjunction with Selenium to provide an automated
test infrastructure that can simulate a user’s interaction with an
Angular application running in a browser or mobile device.
Protractor is a wrapper around WebDriverJS, the JavaScript bindings
for the Selenium WebDriver API.
Also see:
Automated e2e testing- WebDriverJS, Jasmine and Protractor
With protractor, you can write e2e tests with JavaScript, the language you write with Angular app.
Also, it has Angular-specific features.
Its element finders wait for Angular's $digest loop and $http to finish. So you'll have less chance to struggle with sleep and timing issues.
You can select elements with some of common directives such as ng-model, ng-repeat, ng-bind and etc. This is somewhat handy because you may have relatively less ids and classes in Angular apps because you need them only for CSS.

Can protractor test an already deployed Angular application?

I am working on an Angular application that is deployed as a component within another web application. It relies on REST apis of the parent application. Can protractor be configured to run against an already deployed application or would I be better off using Selenium directly for e2e testing?
Yes it can. Look at the Protractor docs, they are shown to be testing the AngularJS site: https://github.com/angular/protractor/blob/master/docs/getting-started.md#writing-tests

Resources