Using REST and UI Testing to Test an Ajax Web Application

Slides:



Advertisements
Similar presentations
Testing Web Applications & Services Testing Web Applications & Web Services.
Advertisements

© 2007 IBM Corporation IBM Emerging Technologies Enabling an Accessible Web 2.0 Becky Gibson Web Accessibility Architect.
ITWS-2210 / CSCI Logistics Format – Class w/ mini projects (graded on class participation) – Labs (individual projects, graded on completion in.
BY: KYLE ROGAHN COMPUTER SCIENCE SEMINAR UW PLATTEVILLE 4/3/2012 Web Browser Automation - Geb.
UNIT-V The MVC architecture and Struts Framework.
ExtWebDriver Open Source Project Daniel Koo Latha Nagaraj Bryan Robbins 04/23/2014.
JS Skills: From Novice to Guru The “how-to” algorithm.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Modern JavaScript Develop And Design Instructor’s Notes Chapter 1 - (Re) Introducing JavaScript Modern JavaScript Design And Develop Copyright © 2012 by.
Ajax VS Flex A comparison based on shopping cart implementation PoHsu Yeh py2157.
Presentation Title Subtitle DSpace UI Prototype 7 Spring, Angular.js, and the DSpace REST API.
UNDERSTANDING YOUR OPTIONS FOR CLIENT-SIDE DEVELOPMENT IN OFFICE 365 Mark Rackley
AJAX and REST. Slide 2 What is AJAX? It’s an acronym for Asynchronous JavaScript and XML Although requests need not be asynchronous It’s not really a.
Prof. James A. Landay University of Washington Spring 2008 Web Interface Design, Prototyping, and Implementation Rich Internet Applications: AJAX, Server.
ASP.NET MVC An Introduction. What is MVC The Model-View-Controller (MVC) is an architectural pattern separates an application into three main components:
Testing Your Alfresco Add-ons Michael Suzuki Software Engineer.
The New Face of ASP.NET ASP.NET MVC, Razor, and jQuery Ido Flatow | Senior Architect | Sela | This session is.
INTRODUCING HYBRID APP KAU with MICT PARK IT COMPANIES Supported by KOICA
Portlet Development Konrad Rokicki (SAIC) Manav Kher (SemanticBits) Joshua Phillips (SemanticBits) Arch/VCDE F2F November 28, 2008.
Testing Your Alfresco Add-ons Michael Suzuki Software Engineer.
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
Ur/Web: A Simple Model for Programming the Web
Using React, Drupal and Google Chrome to build an interactive kiosk + + =
Real Testing Scenario Strategy: A Real-life TestOps Environment
Ramping Up On The SharePoint Framework (SPFx)
Introduction to.
DHTML.
Web Technologies Computing Science Thompson Rivers University
Web API - Introduction AJAX, Spring Data REST SoftUni Team Web API
How to Test a Complex ERP Application using a Data-Driven Framework
WWU Hackathon May 6 & 7.
Kendo UI Builder Bob Brennan
Introduction to Redux Header Eric W. Greene Microsoft Virtual Academy
AJAX and REST.
CMPE 280 Web UI Design and Development October 26 Class Meeting
Presented by Kenny Duenke and Patrick Witbrod
Web Engineering.
Haritha Dasari Josue Balandrano Coronel -
KnockoutJS -Pradeep Shet 31st August 2014.
AJAX.
User Interface / User Experience Demo
Developing an Online Admissions Application Using HTML5, CSS3, AngularJS, Twitter Bootstrap, and Web Services UNM Tech Days 2016 June 10, :30am-10:30am,
CS5220 Advanced Topics in Web Programming Course Overview
Best Angular 2 interview questions and Answer that have been designed for Angular 2 programmers who are preparing online interviews on Angular 2 interviews question. Visit Website:
Not Sure how you Should React
Top 5 Javascript Frameworks
React Revived Web Driver IO for Testers
ASP.NET Web Forms Vs. ASP.NET MVC ASP.NET is Microsoft’s big leap after Active Server Pages (ASP), ASP.NET provides flexible and unified web development.
Top Reasons to Choose Angular. Angular is well known for developing robust and adaptable Single Page Applications (SPA). The Application structure is.
Project: GenericFrame
Displaying Form Validation Info
Real Testing Scenario Strategy: Bringing this all together – Success!
Web Browser server client 3-Tier Architecture Apache web server PHP
Selenium vs Protractor
SPA Revolution with WebAssembly and Blazor Rainer Stropek | software
Modern web applications
Lecture 1: Multi-tier Architecture Overview
Rich single page applications with SharePoint
Ultimate Requirements & Test Management
Modern web applications
Integration (API) testing with SoapUI
Agile testing for web API with Postman
Choosing between Silverlight and AJAX
An Introduction to JavaScript
Web Technologies Computing Science Thompson Rivers University
CS5220 Advanced Topics in Web Programming Course Overview
Web Client Side Technologies Raneem Qaddoura
Western Mass Microsoft Technology Users Group
Web Software Model CS 4640 Programming Languages for Web Applications
Presentation transcript:

Using REST and UI Testing to Test an Ajax Web Application Presented by Adam Sandman Software Testing Professionals Conference Spring 2018 | Newport Beach, CA

Agenda Presentation Tier of Modern Applications Page Lifecycle in an AJAX Web Application Explanation of Testable Areas Recommended Test Strategy Integrating DOM and REST Testing Practical Tips and Tools Questions

Takeaways The value of testing an application from multiple architectural tiers The benefits of combined testing of the User Interface and REST services Tools, techniques and processes you can use to test the UI and REST services

Web Presentation Tier Modern Frameworks and the AJAX Page Lifecycle

Typical 3-Tier Architecture

Traditional Web Applications <html> <head>…. </head> <body> <h1>Products</h1> <table id=“prd” style=“….”> ….. </table> </body> </html>

The AJAX Web Application Model { products: [ { id: 1, name: “product 1” }, { id: 2, name: “product 2” }, { id: 3, name: “product 3” } ] }

Possible Web Frameworks First Generation Prototype, Mootools, jQuery, ASP.NET AJAX, ExtJS, YUI, GWT Second Generation AngularJS 1.0, Knockout, Backbone, Handlebars, Ember, Mustache Latest Generation React Angular 2.0+ Vue

React – Components & Virtual DOM - html - head - body - h1: “Products” - table id: “prd” style: “….” - tr … <Table cancelClick={props.dataCancelEdit} data={props.data} deleteClick={props.dataDelete} editClick={props.dataSetEdit} editId={props.dataEditingId} editChange={props.dataChange} …

Angular export class ProductsComponent implements OnInit { products: Product[]; ngOnInit() { this.products = this.svc.getProds(); } <h1>Products</h1> <table> <tr *ngFor=“let product of products”> <td> {{ product.name }} </td> </tr> </table>

Testable Areas

OK So What Can We Test? JSON Data Returned from REST Calls Rendered Browser DOM JS Framework React Virtual DOM Component State Angular Components Services

Test JSON Data Returned Advantages Well defined API and data structures – resilient Unit testing of key modules Fast to load in test data Not impacted by browser speed or rendering quirks Disadvantages Does not test the end user experience No testing of any client side business login, validation Does not validate rendering, templating of JSON

Test Rendered Browser DOM Advantages Most realistic testing, validates what the end user experiences Finds issues due to browser quirks, differences Can test for usability, performance, responsive design, etc. Disadvantages Scenario testing only, cannot test until entire page is rendered Hard to test specific page components in isolation Changes in DOM, can potentially break tests – need skill to write resilient tests

Test ReactJS Virtual DOM Advantages Can test elements of the rendered page without needing the entire page Easier to test specific components with varying data sets Removes browser speed, quirks from tests Disadvantages Ignores browser differences Not full reflection of user experience Changes to markup in templates will break tests, so not fully resilient Does not catch DOM-based performance issues

Test ReactJS Component State Advantages Easier to test specific components with varying data sets Tests the client-side business logic (vs. server- side unit tests) Can test exception cases Resilient to most UI changes Disadvantages Does not test rendering of state/properties into HTML Tests tied directly to React, limited reusability with other JS frameworks Does not test end user experience of application

Test Strategy & Practical Demo

Sample Test Coverage Resilience vs. Realism Browser DOM Virtual DOM UI “Component” Tests REST JSON Tests Server Side Unit Tests Testing Breadth

Sample Application – DOM & REST

Sample Application – ReactJS http://www.libraryinformationsystem.org/react-js

Sample Application – Angular JS http://www.libraryinformationsystem.org/angular-1/

See It In Action!

Tips and Tools

Top Tools for REST Testing Postman SoapUI Rapise vREST Parasoft Groovy

Top Tools for Browser DOM Testing Selenium (WebDriver) Rapise Ranorex TestComplete Tricentis HP UFT Squish

JS Framework Specific Tools React Testing Component State TestUtils + Jasmine TestUtils + JEST TestUtils + Mocha Testing Virtual DOM Enzyme + Mocha Angular Testing Services Jasmine Mocha Testing Components TestBed + Jasmine TestBed + Mocha

Wrap Up Modern web applications are complex and hard to test You need to test each of the different tiers Some tiers are easier to test than others You need to carefully plan your testing to have the best coverage of the tiers with least effort

Questions?

Thank you for attending this workshop/session. Please fill out an evaluation form.