Skip to main content
Growing Trends Of Open
Source UI Frameworks
A Quick Introduction
• DanielGiordano
• MarketingManager,CrossBrowserTesting
1
UI Testing Frameworks
Today’s Agenda
• WhatDoWeMeanByAutomationFrameworks
• DifferentTypesOfFrameworks
• SelectingTheRightFramework
• PopularBrowserTestingFrameworks
• NightWatchDemo
UI Testing Frameworks
Page
Proprietary & ConfidentialUI Testing Frameworks
Test Frameworks In SDLC
Requirements Tests Defects
What We Expect Configuration & Test
Definition Sets Environments
Actual Test Results
What is a Test Automation
Framework?
UI Testing Frameworks
Page
Proprietary & ConfidentialUI Testing Frameworks
What is a Test Automation Framework?
It’sasetofrules,tools,andspecificationsthatprovidesupportandeaseoftestingforaparticularproductorapplication.
Many times a test framework is responsible for:
Definingandassertingexpectations
Drivingthetestinteractiontheapplication
Executingthetest
Reportingontests
Page
Proprietary & ConfidentialUI Testing Frameworks
A Framework Is Not A ā€œShortcutā€
Yes it is.
ā€œIf what we test is changing, our assertions
should change.ā€
ā€œIf the HTML changes, our Page Objects
should change.ā€
ā€œIf our environments need to change, then our
driver .config file needs to change.
Don’t confuse ā€œTypesā€ of testing
with ā€œToolsā€ of testing.
UI Testing Frameworks
Page
Proprietary & ConfidentialUI Testing Frameworks
Adding Up An Automation Framework
Assertions
Assertionshelpusmakesuretests
returnexpectedresults.
// Chai expect
expect(foo).to.be.a('string')
expect(foo).to.equal('bar')
Test Runners
Controlsandinteractswithbrowsers
toexecuteframework
.url('http://www.github.com')
.waitForElementVisible('body', 1000)
.setValue('form[action="/search"]
input[name="q"]', 'nightwatch')
.keys(browser.Keys.ENTER)
Test Framework
Aframeworkgivesourteststructure
andcommonsyntax.
describe('#save()', function() {
it('should save without
error', function(done)
}
Page
Proprietary & ConfidentialUI Testing Frameworks
Types Of Automated Testing
End to End TestingUnit Testing
• Smallpiecesofcodetestingsinglefunctions
• Thinkā€œnoneedforaURLtotestā€
• Thinklarger interactionsthatmimichumans
• Testingseveralā€unittestsā€strungtogether
 ā€Log Inā€ Button Clicks
Or
 ā€œ2+2=4ā€
 CrossBrowserTesting.com loads
 Click ā€œLog Inā€ Button
 Fill in Username
 Fill in Password
 Click ā€œLog Inā€ Button
Page
Proprietary & ConfidentialUI Testing Frameworks
Unit Testing E2EAutomation
AssertionsRunner
NightWatchJS
WebDriver.IO
Casper.JS
Mocha,
Jasmine
Should
Frameworks
Chai
Siz
e of
= Popularity
Protractor
Page
Proprietary & ConfidentialUI Testing Frameworks
Why Are JavaScript Frameworks So Popular?
Because JavaScript is the language of the web.
Page
Proprietary & ConfidentialUI Testing Frameworks
Downloads of Popular JS Frameworks
Page
Proprietary & Confidential
Let’s Compare Two
UnitTesting Frameworks
UI Testing Frameworks
Mocha Jasmine
Assertion Library Has none out of box. Choose between
Chai, should, better-expect, expect.js
expect(calculator.add(1, 4)).to.equal(5);
Comes out of the box.
expect(calculator.add(1, 4)).toEqual(5);
Spies Has none out of box. Uses Sinon Comes out of the box.
Asynch Testing Does it really well Does it really well in 2.X
BDD/TDD Yes, both. Yes, both.
Community Really active community since it’s the hot
stock on the street.
Older, more mature documentation and
community base
Page
Proprietary & ConfidentialUI Testing Frameworks
Let’s Compare Three
E2E Testing
Nightwatch Protractor WebDriver.IO
Specialty Easy, out of the box set up Angular testing Customization
Architecture Custom implementation of W3C
webdriver JSON wire protocol
Selenium Wrapper Custom implementation of W3C
webdriver JSON wire protocol
Assertion Library Mocha, Its Own Chai, Jasmine, Mocha Chai, Jasmine, Mocha
Parallel Testing Yes Yes Yes
POM Support Yes Yes Yes
Page
Proprietary & ConfidentialUI Testing Frameworks
Critera For Selection
 End to End Capabilities
 Assertions
 BDD/TDD Friendly
 Tool Documentation
 Visual Testing
 CI Integrations
 Dev Language
 App Language
 CloudSupport
Community Size
Style Fit
Technical Fit
Why Run Your Tests In The Cloud
Using CrossBrowserTesting?
UI Testing Frameworks
Page
Proprietary & ConfidentialUI Testing Frameworks
Running In The Cloud
CrossBrowserTesting’s Device Cloud
SeleniumorAppiumscriptsgetcreated
andexecutedasnormal,withonlyafew
changestothecode.
Seleniumsendscommandstoour
browsersandmobiledevicesandwesend
thetestresultsbacktotheuser.
Page
Proprietary & Confidential
19
Selenium Training
Test Coverage Speed No Hassle Cost
Page
Proprietary & Confidential
Test Coverage
20
Selenium Training
• AllMajor Operating Systems
• Windows XP, 7, 8, 10
• Mac 10.3-10.7
• Ubuntu
• 1500+ DesktopBrowsers
• Chrome, Firefox, Safari, Edge, IE 6-11
• RealAndroid & iOS
• iPhone 5, 5 Plus, 6, 6 Plus,7
• iPadPro, Mini, Air2
• Nexus6, 6p, 7, 9
• GalaxyS5, S6, S7
Page
Proprietary & Confidential
Speed
Selenium Training
Test 2Test 2Test 2
Test 3 Test 3 Test 3
When we run automated tests
sequentially we are limited in how
many we can execute in a short period
of time.
Test 1Test 1 Test 1
Test 1
Test 1
Test 1
Test 2
Test 2
Test 2
Test 3
Test 3
Test 3
With parallel test
execution we can test
many cases and
browsers at once.
21
Page
Proprietary & Confidential
Hassle Free
22
Selenium Training
Page
Proprietary & Confidential
Cost
23
That is twentythousand dollars worth
of hardwarein one time.These
phones have atwo yearlife-cycle.
CrossBrowserTesting Introduction
What Does It Look
Like?
UI Testing Frameworks
Page
Proprietary & ConfidentialUI Testing Frameworks
Page
Proprietary & ConfidentialUI Testing Frameworks
Page
Proprietary & ConfidentialUI Testing Frameworks
Test Automation Frameworks In SDLC
Requirements Tests Defects
What We Expect Configuration & Test
Definition Sets Environments
Actual Test Results
Assertions Test Results
Style Cloud
Frameworks
Github.com/crossbrowsertesting
Allofourexamplesandtutorials.
UI Testing Frameworks
Questions?
UI Testing Frameworks
Thank you!
Subtitle