SlideShare a Scribd company logo
Automated Web Testing
using JavaScript
Simon Guest
simon.guest@neudesic.com
Distinguished Engineer
Neudesic, LLC
Why bother with tests?

2
Confidence in your application

3
If I change something, I‟m confident that I didn‟t break the application
If I install something, I‟m confident that it didn‟t break the application
At any point, I‟m confident that the application still works as expected

4
Types of tests

5
Unit Test – test discreet methods, functions, or services
E2E Test – test end to end operation of the application
Compatibility Test – test with different browsers/devices/environments
Performance Test – test with various loads and stress

Security Test – test the confidentiality and integrity of the application

6
Tools for testing

7
8
“Undercurrent” of JavaScript tools for testing

9
Why JavaScript for testing?

10
No cost to download
Open source frameworks can be forked/modified
Very modular – combination of frameworks and runners
Vibrant and active development
If I‟m writing my client and server in JavaScript, why not my tests?

11
http://qunitjs.com
JavaScript unit testing framework
Used to test jQuery, jQuery UI and jQuery Mobile

test("a basic test example", function() {

ok( true, "this test is fine" );
var value = "hello";
equal( value, "hello", "We expect value to be hello" );
});
Demo 12
Testing what the user actually “sees”

Demo 13
http://seleniumhq.org
Web Application testing platform
Open source (Apache 2.0), released by TW in 2004
Selenium IDE – basic recorder, implemented as a Firefox Extension
Selenium WebDriver – “remote control” for browser

Selenium Grid – instantiate browsers on remote machines
Demo - IDE 14
Shortcomings of Selenium IDE

15
No test inheritance
Output is HTML, not script
Difficult to inject any complex logic
Has to be manually run through Firefox

16
Tests

WebDriver

Selenium Host
Browser

Application to test
17
http://pivotal.github.io/jasmine/
BDD Framework for writing JavaScript tests
Clean syntax
Support for mocks (spies)
describe("a basic test example", function() {
it(“tests that true is always the truth”, function() {
expect(true).toBe(true);
});
});
18
Protractor

https://github.com/angular/protractor
Testing framework for AngularJS, built on top of WebDriverJS
Supports Jasmine tests by default
(Mocha coming soon)
Scripts to support easy install of Selenium
npm install –g protractor
webdriver-manager update

webdriver-manager start

19
Tests (Jasmine)

Protractor
WebDriverJS
Selenium Host
Browser (Chrome)

Application to test
Demo 20
Can I do unit testing using Selenium also?

21
Tests (Jasmine)

Protractor
WebDriverJS
Selenium Host
Browser (Chrome)

QUnit Web Page
Demo 22
Do I have to launch a browser?

23
http://phantomjs.org
Headless (Qt)WebKit with JavaScript API
Ability to act as a browser without actually having a GUI
Ideal for running in hosted instances (e.g. docker)
page.open(„http://localhost:8088‟, function(status) {
page.evaluate(function() {
/* test elements on the page */
});

});
Demo - Phantom 24
Nice, but yet another framework?

25
Tests (Jasmine)

Protractor
WebDriverJS
Selenium Host
Browser (PhantomJS)

Application to test
26
Tests (Jasmine)

Protractor
GhostDriver (PhantomJS)

Application to test
Demo 27
Conclusion

28
Testing is really important to maintain confidence in your application
Abundance of JavaScript testing frameworks, many of which are modular
Unit and end-to-end tests in both browser-based and headless mode

29
Q&A
Sample Code: http://github.com/neudesic/engineering-excellence

Simon Guest
simon.guest@neudesic.com
Distinguished Engineer
Neudesic, LLC30

More Related Content

What's hot (20)

KEY
Jellyfish, JSCONF 2011
Adam Christian
 
PPTX
Better End-to-End Testing with Page Objects Model using Protractor
Kasun Kodagoda
 
PDF
Front-End Testing: Demystified
Seth McLaughlin
 
PPTX
Protractor Tutorial Quality in Agile 2015
Andrew Eisenberg
 
PDF
UI Testing Automation
AgileEngine
 
PPTX
Automated Testing with Cucumber, PhantomJS and Selenium
Dev9Com
 
PDF
Join the darkside: Selenium testing with Nightwatch.js
Seth McLaughlin
 
PPTX
Automated Smoke Tests with Protractor
🌱 Dale Spoonemore
 
PPTX
An Introduction to AngularJS End to End Testing using Protractor
Cubet Techno Labs
 
PPTX
Selenium for Jobseekers
Seshu Madhav Chaturvedula
 
PPTX
Using protractor to build automated ui tests
🌱 Dale Spoonemore
 
PPTX
Protractor training
Sergiy Stotskiy
 
PPTX
ProtractorJS for automated testing of Angular 1.x/2.x applications
Binary Studio
 
PDF
Testing with Codeception
Jeremy Coates
 
PDF
Testing with Codeception (Webelement #30)
Adam Štipák
 
PPTX
Browser Automated Testing Frameworks - Nightwatch.js
Luís Bastião Silva
 
PPTX
Protractor Testing Automation Tool Framework / Jasmine Reporters
Haitham Refaat
 
PPTX
CI / CD w/ Codeception
Tudor Barbu
 
DOCX
Protractor end-to-end testing framework for angular js
codeandyou forums
 
PDF
Selenium Testing on Chrome - Google DevFest Armenia 2015
Sargis Sargsyan
 
Jellyfish, JSCONF 2011
Adam Christian
 
Better End-to-End Testing with Page Objects Model using Protractor
Kasun Kodagoda
 
Front-End Testing: Demystified
Seth McLaughlin
 
Protractor Tutorial Quality in Agile 2015
Andrew Eisenberg
 
UI Testing Automation
AgileEngine
 
Automated Testing with Cucumber, PhantomJS and Selenium
Dev9Com
 
Join the darkside: Selenium testing with Nightwatch.js
Seth McLaughlin
 
Automated Smoke Tests with Protractor
🌱 Dale Spoonemore
 
An Introduction to AngularJS End to End Testing using Protractor
Cubet Techno Labs
 
Selenium for Jobseekers
Seshu Madhav Chaturvedula
 
Using protractor to build automated ui tests
🌱 Dale Spoonemore
 
Protractor training
Sergiy Stotskiy
 
ProtractorJS for automated testing of Angular 1.x/2.x applications
Binary Studio
 
Testing with Codeception
Jeremy Coates
 
Testing with Codeception (Webelement #30)
Adam Štipák
 
Browser Automated Testing Frameworks - Nightwatch.js
Luís Bastião Silva
 
Protractor Testing Automation Tool Framework / Jasmine Reporters
Haitham Refaat
 
CI / CD w/ Codeception
Tudor Barbu
 
Protractor end-to-end testing framework for angular js
codeandyou forums
 
Selenium Testing on Chrome - Google DevFest Armenia 2015
Sargis Sargsyan
 

Viewers also liked (19)

PDF
Protractor: Tips & Tricks
Sergey Bolshchikov
 
PPTX
Angular UI Testing with Protractor
Andrew Eisenberg
 
PDF
Introduction to Protractor
Jie-Wei Wu
 
PDF
Testing at Yammer with FooUnit, Jellyfish, and Sauce Labs
Sauce Labs
 
PDF
Intro to testing Javascript with jasmine
Timothy Oxley
 
PPTX
Обзор автоматизации тестирования на JavaScript
COMAQA.BY
 
PPTX
Severity и Priority для неначинающих: очевидное и невероятное
Deutsche Post
 
PDF
Javascript Test Automation Workshop (21.08.2014)
Deutsche Post
 
PDF
Testing nightwatch, by David Torroija
David Torroija
 
PDF
20160905 - BrisJS - nightwatch testing
Vladimir Roudakov
 
PPTX
Tooling for the productive front-end developer
Maurice De Beijer [MVP]
 
PDF
從改寫後台 jQuery 開始的 Vue.js 宣告式渲染
Sheng-Han Su
 
PDF
5-Whys Method
Deutsche Post
 
PPTX
XPATH
Sun Technlogies
 
PDF
JUnit Kung Fu: Getting More Out of Your Unit Tests
John Ferguson Smart Limited
 
PDF
Cucumber.js: Cuke up your JavaScript!
Julien Biezemans
 
PDF
Sharing the pain using Protractor
Anand Bagmar
 
PDF
Perils of Page-Object Pattern
Anand Bagmar
 
PDF
Test Data - Food for your Test Automation Framework
Anand Bagmar
 
Protractor: Tips & Tricks
Sergey Bolshchikov
 
Angular UI Testing with Protractor
Andrew Eisenberg
 
Introduction to Protractor
Jie-Wei Wu
 
Testing at Yammer with FooUnit, Jellyfish, and Sauce Labs
Sauce Labs
 
Intro to testing Javascript with jasmine
Timothy Oxley
 
Обзор автоматизации тестирования на JavaScript
COMAQA.BY
 
Severity и Priority для неначинающих: очевидное и невероятное
Deutsche Post
 
Javascript Test Automation Workshop (21.08.2014)
Deutsche Post
 
Testing nightwatch, by David Torroija
David Torroija
 
20160905 - BrisJS - nightwatch testing
Vladimir Roudakov
 
Tooling for the productive front-end developer
Maurice De Beijer [MVP]
 
從改寫後台 jQuery 開始的 Vue.js 宣告式渲染
Sheng-Han Su
 
5-Whys Method
Deutsche Post
 
JUnit Kung Fu: Getting More Out of Your Unit Tests
John Ferguson Smart Limited
 
Cucumber.js: Cuke up your JavaScript!
Julien Biezemans
 
Sharing the pain using Protractor
Anand Bagmar
 
Perils of Page-Object Pattern
Anand Bagmar
 
Test Data - Food for your Test Automation Framework
Anand Bagmar
 
Ad

Similar to Automated Testing using JavaScript (20)

PPTX
Growing Trends of Open Source UI Frameworks
SmartBear
 
PPTX
Test automation using selenium
Cynoteck Technology Solutions Private Limited
 
PDF
International journal of applied sciences and innovation vol 2015 - no 1 - ...
sophiabelthome
 
PPTX
Web UI Tests: Introduce UI tests using Selenium
Peyman Fakharian
 
PPTX
Codeception
少東 張
 
PPTX
Automated Testing Of EPiServer CMS Sites
joelabrahamsson
 
PPTX
Basics of selenium containing features of selenium
Madhuri Lonikar
 
DOCX
Amit (Automation Testing)
AMIT SINGH
 
PDF
Good practices for debugging Selenium and Appium tests
Abhijeet Vaikar
 
PPTX
前端網頁自動測試
政億 林
 
PPTX
Android Automation Testing with Selendroid
Vikas Thange
 
PPT
Enterprise Ready Test Execution Platform for Mobile Apps
Vijayan Srinivasan
 
PPTX
Real world selenium resume which gets more job interviews
ABSoft Trainings
 
PPT
Selenium Presentation at Engineering Colleges
Vijay Rangaiah
 
PPT
Selenium using C# by Yogesh Kumar
Software Testing Board
 
PPT
Selenium
Sun Technlogies
 
PPTX
Test Automation Using Selenium
Nikhil Kapoor
 
PDF
selenium meetup sf talk march 2014 Selenium at Scale
David Louvton
 
PDF
Automated Testing in DevOps
Haufe-Lexware GmbH & Co KG
 
PDF
Salesforce selenium-saucelabs-webinar-april-2014
Sauce Labs
 
Growing Trends of Open Source UI Frameworks
SmartBear
 
Test automation using selenium
Cynoteck Technology Solutions Private Limited
 
International journal of applied sciences and innovation vol 2015 - no 1 - ...
sophiabelthome
 
Web UI Tests: Introduce UI tests using Selenium
Peyman Fakharian
 
Codeception
少東 張
 
Automated Testing Of EPiServer CMS Sites
joelabrahamsson
 
Basics of selenium containing features of selenium
Madhuri Lonikar
 
Amit (Automation Testing)
AMIT SINGH
 
Good practices for debugging Selenium and Appium tests
Abhijeet Vaikar
 
前端網頁自動測試
政億 林
 
Android Automation Testing with Selendroid
Vikas Thange
 
Enterprise Ready Test Execution Platform for Mobile Apps
Vijayan Srinivasan
 
Real world selenium resume which gets more job interviews
ABSoft Trainings
 
Selenium Presentation at Engineering Colleges
Vijay Rangaiah
 
Selenium using C# by Yogesh Kumar
Software Testing Board
 
Selenium
Sun Technlogies
 
Test Automation Using Selenium
Nikhil Kapoor
 
selenium meetup sf talk march 2014 Selenium at Scale
David Louvton
 
Automated Testing in DevOps
Haufe-Lexware GmbH & Co KG
 
Salesforce selenium-saucelabs-webinar-april-2014
Sauce Labs
 
Ad

More from Simon Guest (20)

PDF
10 Life Hacks for Better Productivity
Simon Guest
 
PDF
Building a Great Engineering Culture
Simon Guest
 
PDF
Interviewing Techniques
Simon Guest
 
PDF
Presentation Anti-Patterns
Simon Guest
 
PDF
10 Life Hacks for Better Productivity
Simon Guest
 
PDF
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
PDF
Indoor location in mobile applications using iBeacons
Simon Guest
 
PPTX
Creating Context-Aware Applications
Simon Guest
 
PDF
Enterprise Social Networking - Myth or Magic?
Simon Guest
 
PPTX
Objective View of MEAPs
Simon Guest
 
PPTX
Top Ten Tips for HTML5/Mobile Web Development
Simon Guest
 
PPTX
Windows Azure Toolkit for iOS
Simon Guest
 
PPTX
Developing Enterprise-Grade Mobile Applications
Simon Guest
 
PPTX
My customers are using iPhone/Android, but I'm a Microsoft Guy.
Simon Guest
 
PPTX
Developing iPhone and iPad apps that leverage Windows Azure
Simon Guest
 
PPTX
iPhone and iPad Security
Simon Guest
 
PPTX
Building solutions on the Microsoft platform that target iPhone, iPad, and An...
Simon Guest
 
PPTX
Future of Mobility
Simon Guest
 
PDF
Patterns for Cloud Computing
Simon Guest
 
PDF
ReMix Keynote (Vienna, Austria)
Simon Guest
 
10 Life Hacks for Better Productivity
Simon Guest
 
Building a Great Engineering Culture
Simon Guest
 
Interviewing Techniques
Simon Guest
 
Presentation Anti-Patterns
Simon Guest
 
10 Life Hacks for Better Productivity
Simon Guest
 
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
Indoor location in mobile applications using iBeacons
Simon Guest
 
Creating Context-Aware Applications
Simon Guest
 
Enterprise Social Networking - Myth or Magic?
Simon Guest
 
Objective View of MEAPs
Simon Guest
 
Top Ten Tips for HTML5/Mobile Web Development
Simon Guest
 
Windows Azure Toolkit for iOS
Simon Guest
 
Developing Enterprise-Grade Mobile Applications
Simon Guest
 
My customers are using iPhone/Android, but I'm a Microsoft Guy.
Simon Guest
 
Developing iPhone and iPad apps that leverage Windows Azure
Simon Guest
 
iPhone and iPad Security
Simon Guest
 
Building solutions on the Microsoft platform that target iPhone, iPad, and An...
Simon Guest
 
Future of Mobility
Simon Guest
 
Patterns for Cloud Computing
Simon Guest
 
ReMix Keynote (Vienna, Austria)
Simon Guest
 

Recently uploaded (20)

PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 

Automated Testing using JavaScript