SlideShare a Scribd company logo
“An Introduction to AngularJS End to End
Testing using Protractor”
Cubet Seminar
Presented by “Jenson”
“We help build and architect IT solutions”
About Cubet
Founded in 2007, Cubet Techno Labs
is an end-to-end SMAC (social,
mobile, analytics and cloud) consulting
company with offices at Kochi, India
and London, UK. With expertise in
insightful product strategy, well-crafted
design and proficient development for
high-end web and mobile application
technologies.
Where we stand
Visit – www.cubettech.com
What is Protractor ?
Visit – www.cubettech.com
 An AngularJS E2E Testing Framework
 Find Issues -Integration between components
 Introduced during AngularJS 1.2 and Beyond presentation
 A new replacement of the existing E2E Testing framework
 Nodejs program – end to end test run written in javascript
 Webdriver – control browsers and simulate user actions
 Jasmin – test syntax
 Allows running tests targeting remote addresses, No longer
need to have test files on the server being tested
What’s Different ?
Visit – www.cubettech.com
 Built on WebdriverJS and Selenium Server
 New syntax when writing tests
 Allows running tests targeting remote addresses, No longer
need to have test files on the server being tested
 Can take advantage of Selenium Grid to run multiple
browsers at once; ie Sauce Labs
 Has it’s own runner, no need for Karma
 Can use Jasmine or Mocha to write test suites
List of Contents:
Visit – www.cubettech.com
● HOW IT WORKS
● FRAMEWORK OR DRIVERS USED
● HOW TO INSTALL AND RUN
● WRITE A TEST
HOW IT WORKS
Visit – www.cubettech.com
1) Selenium server
Browser automation framework
 Selenium server
 Webdriver APIs
 Browser driver
2) Protractor
Node js program that support jasmine framework
HOW IT WORKS
Visit – www.cubettech.com
• Conjunction of protractor with selenium provide an automated testing infrastructure
• Can simulate user's interaction on angular application running in a browser or
mobile
JASMIN FRAMEWORK
Visit – www.cubettech.com
● It’s a test syntax
● One or more it blocks describe the requirement of your
application
● Commands + expectation = it blocks
● Commands = do something with application
Navigate to a page
Click on a button
Expectation = assert something about the application's state
Value of the field
Current url
Expectation with an it block fails – runner mark it as “failed”
After each and before each
Visit – www.cubettech.com
INSTALLATION
Visit – www.cubettech.com
●Installed via Node Package Manager
npm install protractor
●Install Selenium Standalone Server
node_modules/protractor/bin/install_selenium_standal
one
Note: Require JDK(java development kit)
The webdriver-manager -helper tool to easily get an instance of a Selenium Server running
• webdriver-manager update
• webdriver-manager start
http://localhost:4444/wd/hub
WRITE A TEST
Visit – www.cubettech.com
● Clean folder with
•spec file
•configuration file.
spec.js
describe('Protractor Demo App', function() {
it('should have a title', function() {
browser.get('http://juliemr.github.io/protractor-demo/');
expect(browser.getTitle()).toEqual('Super Calculator');
});
});
The describe and it syntax is from the Jasmine framework
browser - global created by Protractor
The Configuration File
Visit – www.cubettech.com
exports.config = {
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['spec.js'] ,
capabilities: {
browserName: 'firefox'
}
}
Chrome : default browser
RUN COMMAND : protractor config.js
RESULT : 1 tests, 1 assertion, 0 failures
INTERACTING WITH ELEMENTS
Visit – www.cubettech.com
// spec.js
describe('Protractor Demo App', function() {
it('should add one and two', function() {
browser.get('http://juliemr.github.io/protractor-demo/');
element(by.model('first')).sendKeys(1);
element(by.model('second')).sendKeys(2);
element(by.id('gobutton')).click();
expect(element(by.binding('latest')).getText()).
toEqual('5');
// This is wrong!
});
});
<input type=text ng-model="first">.
Finding Elements in a Test
Visit – www.cubettech.com
Use Selenium WebdriverJS Syntax:
ptor.findElement(protractor.By.x(‘...’));
or
ptor.findElements(protractor.By.x(‘...’));
findElement returns a single element, findElements returns an
array of elements.
Both will throw an exception if the locator cannot find the element
on the page
Protractor Locators
Visit – www.cubettech.com
protractor.By.className('redBtn')
protractor.By.css('.redBtn')
protractor.By.id('loginButton')
protractor.By.linkText('Go Home')
protractor.By.partialLinktext('Home')
protractor.By.name('email')
protractor.By.tagName('h2')
protractor.By.xpath('')
Protractor Locators (cont)
Visit – www.cubettech.com
protractor.By.binding('{{status}}')
protractor.By.select("user")
protractor.By.selectedOption("red")
protractor.By.input("user")
protractor.By.repeater("cat in pets")
protractor.By.repeater("cat in pets").row(1).column("{{cat.name}}"))
WebElement Methods
Visit – www.cubettech.com
clear() If this element is a text entry element, this will clear the value.
click() Click this element.
getAttribute(name) Get the value of a the given attribute of the element.
getCssValue(propertyName) Get the value of a given CSS property.
getLocation() Where on the page is the top left-hand corner of the rendered element?
getSize() What is the width and height of the rendered element?
getTagName() Get the tag name of this element.
WebElement Methods (cont)
Visit – www.cubettech.com
getText() Get the visible (i.e. not hidden by CSS) innerText of this element, including
sub-elements, without any leading or trailing whitespace.
isDisplayed() Is this element displayed or not? This method avoids the problem of having
to parse an element's "style" attribute.
isEnabled() Is the element currently enabled or not? This will generally return true for
everything but disabled input elements.
isSelected() Determine whether or not this element is selected or not.
sendKeys(keysToSend) Use this method to simulate typing into an element, which may set its value.
Resources
Visit – www.cubettech.com
Protractor Github Page - https://github.com/angular/protractor
WebdriverJS User Guide - https://code.google.com/p/selenium/wiki/WebDriverJs
Stackoverflow WebdriverJS Content - http://stackoverflow.com/search?q=%5Bselenium%5D+webdriverjs
Our Technologies Stack:
Server Side Application JavaScript Frameworks
Mobile App Development
Database System and Cloud
Visit – www.cubettech.com
THANKS!
ANY QUESTIONS? PLEASE GET IN TOUCH!
www.cubettech.com
Email : info@cubettech.com
Skype : cubet.se
Phone: +91 484 405 4324
Contact us:
Kemp House
160 City Road
London- EC1V2NX,
UK.info@cubettech.com
+44 2071938618
Carnival Info Park,
Unit IX-C, 9th floor
PhaseIV,
Kochi, Kerala, India
info@cubettech.com
+91 484 4054324

More Related Content

What's hot (20)

Protractor survival guide
Protractor survival guideProtractor survival guide
Protractor survival guide
László Andrási
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
Florian Fesseler
 
Automated Smoke Tests with Protractor
Automated Smoke Tests with ProtractorAutomated Smoke Tests with Protractor
Automated Smoke Tests with Protractor
🌱 Dale Spoonemore
 
Protractor end-to-end testing framework for angular js
Protractor   end-to-end testing framework for angular jsProtractor   end-to-end testing framework for angular js
Protractor end-to-end testing framework for angular js
codeandyou forums
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScript
Simon Guest
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScript
Simon Guest
 
Protractor: Tips & Tricks
Protractor: Tips & TricksProtractor: Tips & Tricks
Protractor: Tips & Tricks
Sergey Bolshchikov
 
Using protractor to build automated ui tests
Using protractor to build automated ui testsUsing protractor to build automated ui tests
Using protractor to build automated ui tests
🌱 Dale Spoonemore
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
Jim Lynch
 
Workshop - E2e tests with protractor
Workshop - E2e tests with protractorWorkshop - E2e tests with protractor
Workshop - E2e tests with protractor
Walmyr Lima e Silva Filho
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
Seth McLaughlin
 
Intro to Service Worker API and its use cases
Intro to Service Worker API and its use casesIntro to Service Worker API and its use cases
Intro to Service Worker API and its use cases
satejsahu
 
Testing Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumTesting Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS Curriculum
Brian Jordan
 
Automation using Javascript
Automation using JavascriptAutomation using Javascript
Automation using Javascript
khanhdang1214
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
Sargis Sargsyan
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David Torroija
David Torroija
 
Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: Demystified
Seth McLaughlin
 
Automation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and BeyondAutomation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and Beyond
Alan Richardson
 
Marcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with seleniumMarcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with selenium
Trójmiejska Grupa Testerska
 
APIs: A Better Alternative to Page Objects
APIs: A Better Alternative to Page ObjectsAPIs: A Better Alternative to Page Objects
APIs: A Better Alternative to Page Objects
Sauce Labs
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
Florian Fesseler
 
Automated Smoke Tests with Protractor
Automated Smoke Tests with ProtractorAutomated Smoke Tests with Protractor
Automated Smoke Tests with Protractor
🌱 Dale Spoonemore
 
Protractor end-to-end testing framework for angular js
Protractor   end-to-end testing framework for angular jsProtractor   end-to-end testing framework for angular js
Protractor end-to-end testing framework for angular js
codeandyou forums
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScript
Simon Guest
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScript
Simon Guest
 
Using protractor to build automated ui tests
Using protractor to build automated ui testsUsing protractor to build automated ui tests
Using protractor to build automated ui tests
🌱 Dale Spoonemore
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
Jim Lynch
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
Seth McLaughlin
 
Intro to Service Worker API and its use cases
Intro to Service Worker API and its use casesIntro to Service Worker API and its use cases
Intro to Service Worker API and its use cases
satejsahu
 
Testing Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumTesting Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS Curriculum
Brian Jordan
 
Automation using Javascript
Automation using JavascriptAutomation using Javascript
Automation using Javascript
khanhdang1214
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
Sargis Sargsyan
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David Torroija
David Torroija
 
Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: Demystified
Seth McLaughlin
 
Automation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and BeyondAutomation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and Beyond
Alan Richardson
 
APIs: A Better Alternative to Page Objects
APIs: A Better Alternative to Page ObjectsAPIs: A Better Alternative to Page Objects
APIs: A Better Alternative to Page Objects
Sauce Labs
 

Similar to An Introduction to AngularJS End to End Testing using Protractor (20)

Protractor End To End Testing For AngularJS
Protractor End To End Testing For AngularJSProtractor End To End Testing For AngularJS
Protractor End To End Testing For AngularJS
Knoldus Inc.
 
Introduction to Protractor - Habilelabs
Introduction to Protractor - HabilelabsIntroduction to Protractor - Habilelabs
Introduction to Protractor - Habilelabs
HabileLabs
 
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
TestingAR Meetup
 
ProtractorJS for automated testing of Angular 1.x/2.x applications
ProtractorJS for automated testing of Angular 1.x/2.x applicationsProtractorJS for automated testing of Angular 1.x/2.x applications
ProtractorJS for automated testing of Angular 1.x/2.x applications
Binary Studio
 
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Dakiry
 
Knowledge of web ui for automation testing
Knowledge  of web ui for automation testingKnowledge  of web ui for automation testing
Knowledge of web ui for automation testing
Artem Korchevyi
 
Protractor framework architecture with example
Protractor framework architecture with exampleProtractor framework architecture with example
Protractor framework architecture with example
shadabgilani
 
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QAFest
 
Sharing the pain using Protractor
Sharing the pain using ProtractorSharing the pain using Protractor
Sharing the pain using Protractor
Anand Bagmar
 
Presentation_Protractor
Presentation_ProtractorPresentation_Protractor
Presentation_Protractor
Umesh Randhe
 
Protractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersProtractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine Reporters
Haitham Refaat
 
Selenium with protractor
Selenium with protractorSelenium with protractor
Selenium with protractor
BOGA HARIKRISHNA
 
Sharing (less) Pain of using Protractor & WebDriver
Sharing (less) Pain of using Protractor & WebDriverSharing (less) Pain of using Protractor & WebDriver
Sharing (less) Pain of using Protractor & WebDriver
Anand Bagmar
 
Moving from selenium to protractor for test automation
Moving from selenium to protractor for test automationMoving from selenium to protractor for test automation
Moving from selenium to protractor for test automation
Zoe Gilbert
 
Protractor
ProtractorProtractor
Protractor
kapilsethi9
 
How to Use Playwright Locators_ A Detailed Guide.pdf
How to Use Playwright Locators_ A Detailed Guide.pdfHow to Use Playwright Locators_ A Detailed Guide.pdf
How to Use Playwright Locators_ A Detailed Guide.pdf
kalichargn70th171
 
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
Scrum Breakfast Vietnam
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
Sun Technlogies
 
Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)
Will Huang
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
orbitprojects
 
Protractor End To End Testing For AngularJS
Protractor End To End Testing For AngularJSProtractor End To End Testing For AngularJS
Protractor End To End Testing For AngularJS
Knoldus Inc.
 
Introduction to Protractor - Habilelabs
Introduction to Protractor - HabilelabsIntroduction to Protractor - Habilelabs
Introduction to Protractor - Habilelabs
HabileLabs
 
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
TestingAR Meetup
 
ProtractorJS for automated testing of Angular 1.x/2.x applications
ProtractorJS for automated testing of Angular 1.x/2.x applicationsProtractorJS for automated testing of Angular 1.x/2.x applications
ProtractorJS for automated testing of Angular 1.x/2.x applications
Binary Studio
 
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Олександр Хотемський “ProtractorJS як інструмент браузерної автоматизації для...
Dakiry
 
Knowledge of web ui for automation testing
Knowledge  of web ui for automation testingKnowledge  of web ui for automation testing
Knowledge of web ui for automation testing
Artem Korchevyi
 
Protractor framework architecture with example
Protractor framework architecture with exampleProtractor framework architecture with example
Protractor framework architecture with example
shadabgilani
 
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QAFest
 
Sharing the pain using Protractor
Sharing the pain using ProtractorSharing the pain using Protractor
Sharing the pain using Protractor
Anand Bagmar
 
Presentation_Protractor
Presentation_ProtractorPresentation_Protractor
Presentation_Protractor
Umesh Randhe
 
Protractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersProtractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine Reporters
Haitham Refaat
 
Sharing (less) Pain of using Protractor & WebDriver
Sharing (less) Pain of using Protractor & WebDriverSharing (less) Pain of using Protractor & WebDriver
Sharing (less) Pain of using Protractor & WebDriver
Anand Bagmar
 
Moving from selenium to protractor for test automation
Moving from selenium to protractor for test automationMoving from selenium to protractor for test automation
Moving from selenium to protractor for test automation
Zoe Gilbert
 
How to Use Playwright Locators_ A Detailed Guide.pdf
How to Use Playwright Locators_ A Detailed Guide.pdfHow to Use Playwright Locators_ A Detailed Guide.pdf
How to Use Playwright Locators_ A Detailed Guide.pdf
kalichargn70th171
 
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
Scrum Breakfast Vietnam
 
Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)
Will Huang
 
Ad

More from Cubet Techno Labs (6)

Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
Cubet Techno Labs
 
Drupal_cubet seminar
Drupal_cubet seminarDrupal_cubet seminar
Drupal_cubet seminar
Cubet Techno Labs
 
Let's start with REDUX
Let's start with REDUXLet's start with REDUX
Let's start with REDUX
Cubet Techno Labs
 
JMeter_ Cubet Seminar ppt
JMeter_ Cubet Seminar pptJMeter_ Cubet Seminar ppt
JMeter_ Cubet Seminar ppt
Cubet Techno Labs
 
Fabricjs ppt
Fabricjs pptFabricjs ppt
Fabricjs ppt
Cubet Techno Labs
 
Angularjs 2
Angularjs 2 Angularjs 2
Angularjs 2
Cubet Techno Labs
 
Ad

Recently uploaded (20)

AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptxFIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API CatalogMuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdfENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdfCrypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FMESupporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdfHigh Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptxFIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API CatalogMuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdfENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdfCrypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FMESupporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdfHigh Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...Your startup on AWS - How to architect and maintain a Lean and Mean account J...
Your startup on AWS - How to architect and maintain a Lean and Mean account J...
angelo60207
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 

An Introduction to AngularJS End to End Testing using Protractor

  • 1. “An Introduction to AngularJS End to End Testing using Protractor” Cubet Seminar Presented by “Jenson” “We help build and architect IT solutions”
  • 2. About Cubet Founded in 2007, Cubet Techno Labs is an end-to-end SMAC (social, mobile, analytics and cloud) consulting company with offices at Kochi, India and London, UK. With expertise in insightful product strategy, well-crafted design and proficient development for high-end web and mobile application technologies. Where we stand Visit – www.cubettech.com
  • 3. What is Protractor ? Visit – www.cubettech.com  An AngularJS E2E Testing Framework  Find Issues -Integration between components  Introduced during AngularJS 1.2 and Beyond presentation  A new replacement of the existing E2E Testing framework  Nodejs program – end to end test run written in javascript  Webdriver – control browsers and simulate user actions  Jasmin – test syntax  Allows running tests targeting remote addresses, No longer need to have test files on the server being tested
  • 4. What’s Different ? Visit – www.cubettech.com  Built on WebdriverJS and Selenium Server  New syntax when writing tests  Allows running tests targeting remote addresses, No longer need to have test files on the server being tested  Can take advantage of Selenium Grid to run multiple browsers at once; ie Sauce Labs  Has it’s own runner, no need for Karma  Can use Jasmine or Mocha to write test suites
  • 5. List of Contents: Visit – www.cubettech.com ● HOW IT WORKS ● FRAMEWORK OR DRIVERS USED ● HOW TO INSTALL AND RUN ● WRITE A TEST
  • 6. HOW IT WORKS Visit – www.cubettech.com 1) Selenium server Browser automation framework  Selenium server  Webdriver APIs  Browser driver 2) Protractor Node js program that support jasmine framework
  • 7. HOW IT WORKS Visit – www.cubettech.com • Conjunction of protractor with selenium provide an automated testing infrastructure • Can simulate user's interaction on angular application running in a browser or mobile
  • 8. JASMIN FRAMEWORK Visit – www.cubettech.com ● It’s a test syntax ● One or more it blocks describe the requirement of your application ● Commands + expectation = it blocks ● Commands = do something with application Navigate to a page Click on a button Expectation = assert something about the application's state Value of the field Current url Expectation with an it block fails – runner mark it as “failed” After each and before each
  • 10. INSTALLATION Visit – www.cubettech.com ●Installed via Node Package Manager npm install protractor ●Install Selenium Standalone Server node_modules/protractor/bin/install_selenium_standal one Note: Require JDK(java development kit) The webdriver-manager -helper tool to easily get an instance of a Selenium Server running • webdriver-manager update • webdriver-manager start http://localhost:4444/wd/hub
  • 11. WRITE A TEST Visit – www.cubettech.com ● Clean folder with •spec file •configuration file. spec.js describe('Protractor Demo App', function() { it('should have a title', function() { browser.get('http://juliemr.github.io/protractor-demo/'); expect(browser.getTitle()).toEqual('Super Calculator'); }); }); The describe and it syntax is from the Jasmine framework browser - global created by Protractor
  • 12. The Configuration File Visit – www.cubettech.com exports.config = { framework: 'jasmine', seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['spec.js'] , capabilities: { browserName: 'firefox' } } Chrome : default browser RUN COMMAND : protractor config.js RESULT : 1 tests, 1 assertion, 0 failures
  • 13. INTERACTING WITH ELEMENTS Visit – www.cubettech.com // spec.js describe('Protractor Demo App', function() { it('should add one and two', function() { browser.get('http://juliemr.github.io/protractor-demo/'); element(by.model('first')).sendKeys(1); element(by.model('second')).sendKeys(2); element(by.id('gobutton')).click(); expect(element(by.binding('latest')).getText()). toEqual('5'); // This is wrong! }); }); <input type=text ng-model="first">.
  • 14. Finding Elements in a Test Visit – www.cubettech.com Use Selenium WebdriverJS Syntax: ptor.findElement(protractor.By.x(‘...’)); or ptor.findElements(protractor.By.x(‘...’)); findElement returns a single element, findElements returns an array of elements. Both will throw an exception if the locator cannot find the element on the page
  • 15. Protractor Locators Visit – www.cubettech.com protractor.By.className('redBtn') protractor.By.css('.redBtn') protractor.By.id('loginButton') protractor.By.linkText('Go Home') protractor.By.partialLinktext('Home') protractor.By.name('email') protractor.By.tagName('h2') protractor.By.xpath('')
  • 16. Protractor Locators (cont) Visit – www.cubettech.com protractor.By.binding('{{status}}') protractor.By.select("user") protractor.By.selectedOption("red") protractor.By.input("user") protractor.By.repeater("cat in pets") protractor.By.repeater("cat in pets").row(1).column("{{cat.name}}"))
  • 17. WebElement Methods Visit – www.cubettech.com clear() If this element is a text entry element, this will clear the value. click() Click this element. getAttribute(name) Get the value of a the given attribute of the element. getCssValue(propertyName) Get the value of a given CSS property. getLocation() Where on the page is the top left-hand corner of the rendered element? getSize() What is the width and height of the rendered element? getTagName() Get the tag name of this element.
  • 18. WebElement Methods (cont) Visit – www.cubettech.com getText() Get the visible (i.e. not hidden by CSS) innerText of this element, including sub-elements, without any leading or trailing whitespace. isDisplayed() Is this element displayed or not? This method avoids the problem of having to parse an element's "style" attribute. isEnabled() Is the element currently enabled or not? This will generally return true for everything but disabled input elements. isSelected() Determine whether or not this element is selected or not. sendKeys(keysToSend) Use this method to simulate typing into an element, which may set its value.
  • 19. Resources Visit – www.cubettech.com Protractor Github Page - https://github.com/angular/protractor WebdriverJS User Guide - https://code.google.com/p/selenium/wiki/WebDriverJs Stackoverflow WebdriverJS Content - http://stackoverflow.com/search?q=%5Bselenium%5D+webdriverjs
  • 20. Our Technologies Stack: Server Side Application JavaScript Frameworks Mobile App Development Database System and Cloud Visit – www.cubettech.com
  • 21. THANKS! ANY QUESTIONS? PLEASE GET IN TOUCH! www.cubettech.com Email : [email protected] Skype : cubet.se Phone: +91 484 405 4324
  • 22. Contact us: Kemp House 160 City Road London- EC1V2NX, [email protected] +44 2071938618 Carnival Info Park, Unit IX-C, 9th floor PhaseIV, Kochi, Kerala, India [email protected] +91 484 4054324