SlideShare a Scribd company logo
Selenium WebDriverJS based framework for automated
testing of Angular 1.x/2.x applications
OLEKSANDR KHOTEMSKYI
https://xotabu4.github.io/website
 Julie Ralph(Google) is one of the main contributors,
made first commits in January 2013
 Created as an answer to question: ”How to make end
to end tests for AngularJS applications easier?”
 Now ProtractorJS reached version 4.x, with over 1300
commits, 5700 GitHub stars, 200 contributors
 Easier than Java
 Thousands of libraries already exist for JS/NodeJS. Friendly community, tons of open
source code. Package manager already included in NodeJS
 Much easier common code like JSON parsing, sending HTTP requests, and others
 Duck-typing, monkey-patching
 Tools are smaller, and project start is faster
 Newest versions of TypeScript or ECMAScript 6 makes code much easier to write and
understand
 Same language for front-end, back-end and tests means that same code execution
environment
 JS is one of the most popular languages today, and TypeScript is as primary in
Angular 2.0
https://dou.ua/lenta/articles/language-rating-jan-2016/
JAVA C# JavaScript PHP PythonC++ Ruby
 Developed by Microsoft team
 Superset of JavaScript (includes JavaScript)
 Compiles to JavaScript (ECMAScript 3, 5 or 6)
 Optional types! This allows to have autocomplete in IDE
 Easier refactoring of code
 Has features that not yet in JavaScript specification
(@Annotations, async/await)
 Compilation errors, instead of runtime errors in JavaScript
ProtractorJS Java Selenium WebDriver
High-level framework Low-level automation library (not framework)
Uses script languages: TypeScript or JavaScript or
both same time
Uses Java
JasimineJS (test runner and assertions),
SauceLabs/BrowserStack integration, basic reporting,
interactive debugger, command line parameters,
configuration files

Node Package Manager shows ~628 results for
‘protractor’
Maven shows ~422 results for ‘selenium webdriver’
Asynchronous, uses own control-flow, and Promises
objects
Synchronous, traditional approach
Ability to run tests in parallel Parallel running should be done with additional
libraries/frameworks
PageObjects are just objects with attributes and
functions
PageObjects require @FindBy annotations and
PageObjectFactory usage.
Plugins. Extra element locators. Mobile browsers
support (with Appium).
Mobile browsers support.
Test Runner
(JasmineJS,
Cucumber …)
ProtractorJS
Selenium JavaScript official
bindings
NodeJS environment
Test Runner
extensions
Selenium Standalone Server (JAVA)
Other JS modules
HTTP
JSON
ChromeDriver GeckoDriver EdgeDriver SafariDriver Other drivers
• Runs on NodeJS 4.x, 5.x, 6.x
• Can be used with different Test Runners (JasmineJS, CucumberJS, Mocha, others)
• Can connect to browser using WebDriver server or directly (Chrome and Firefox only)
• Supports all browsers that WebDriver does: Chrome, Firefox, Edge, Safari, Opera,
PhantomJS and mobile
• Angular 1.x and Angular 2.x ready!
One of the key features of ProtractorJS that it is uses same JSON WebDriver Wire protocol as other
language bindings.
This code will be executed as 3 separate JSON WebDriver Wire Protocol commands:
Synchronizing with
AngularJS application
Locating element on the
page
Sending ‘click’ action for
element
• Protractor uses ‘Wrapper’ pattern to add own features to standard WebDriver, WebElement, Locators objects
Browser(WebDriver instance)
+
Inherited from WebDriver
• getProcessedConfig
• forkNewDriverInstance
• restart
• useAllAngular2AppRoots
• waitForAngular
• findElement
• findElements
• isElementPresent
• addMockModule
• clearMockModules
• removeMockModule
• getRegisteredMockModules
• get
• refresh
• navigate
• setLocation
• getLocationAbsUrl
• debugger
• enterRepl
• pause
• wrapDriver
actions
touchActions
executeScript
executeAsyncScri
pt
call
wait
sleep
getPageSource
close
getCurrentUrl
getTitle
takeScreenshot
switchTo
ElementFinder
+
Inherited from WebElement• then
• clone
• locator
• getWebElement
• all
• element
• $$
• $
• isPresent
• isElementPresent
• evaluate
• allowAnimations
• equals
• getDriver
• getId
• getRawId
• serialize
• findElement
• click
• sendKeys
• getTagName
• getCssValue
• getAttribute
• getText
• getSize
• getLocation
• isEnabled
• isSelected
• submit
• clear
• isDisplayed
• takeScreenshot
Protractor Locators
+
Inherited from WebDriver Locators• addLocator
• binding
• exactBinding
• model
• buttonText
• partialButtonText
• repeater
• exactRepeater
• cssContainingText
• options
• deepCss
• className
• css
• id
• linkText
• js
• name
• partialLinkText
• tagName
• xpath
 JavaScript is single threaded (mostly)
 To have possibility to do multiple tasks at once – JavaScript run them
all in single thread, and quickly switch between them
 Async tasks are running in isolation. To make execution step by step –
callbacks are used
 Callbacks are just functions, that will be called when async function is
finished. It is like – “call this when you are done”. You can pass any
arguments to them
 Pattern to avoid callback hell, extension of callbacks
 Almost every function from API returns special object – Promise
 Promise is a object, that will be resolved to a value (any), or rejected if
value can’t be returned
 Do not try to write in synchronous manner! You should
think differently when writing async code
 When you asserting results – promises automatically
resolved. Do not worry to resolve promise before
assertion
 To wait something on the page – use browser.wait() or
browser.sleep()
 ES7 features are on their way! async/await will make
our life much easier
 Be brave and good luck
https://gist.github.com/Xotabu4/f26afb9e24397c9d059bb984d30a6b0a
Example of simple test case
JAVA + Pure Selenium JAVA + JUNIT
TypeScript + ProtractorJS + JasmineJS
https://gist.github.com/Xotabu4/dcfe83bc98ad304f58f3b05de9cd6c69
https://gist.github.com/Xotabu4/79ece1d104f2557a70cd079b62f46f45
Example of simple pageObject pattern usage
JAVA + Selenium PageObjectFactory (@FindBy)
TypeScript + ProtractorJS
https://gist.github.com/Xotabu4/a9334f22933d1d6a16c820ccb4bd6635
JAVA:
ProtractorJS:
And useful links:
 Protractor site: http://www.protractortest.org
 Promises, WebDriver Control Flow documentation: http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-
webdriver/lib/promise.html
 Gitter chat: https://gitter.im/angular/protractor
 StackOverflow(top questions): http://stackoverflow.com/questions/tagged/protractor?sort=votes&pageSize=20
 GitHub: https://github.com/angular/protractor
 TypeScript documentation: https://www.typescriptlang.org/docs/tutorial.html
 ES6 features: http://es6-features.org/
 Protractor TypeScript example: https://github.com/angular/protractor/tree/master/exampleTypescript
OLEKSANDR KHOTEMSKYI
https://xotabu4.github.io/website 2016

More Related Content

What's hot

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
 
Automation using Javascript
Automation using JavascriptAutomation using Javascript
Automation using Javascript
khanhdang1214
 
Selenium topic 1- Selenium Basic
Selenium topic 1-  Selenium BasicSelenium topic 1-  Selenium Basic
Selenium topic 1- Selenium Basic
ITProfessional Academy
 
Angular js automation using protractor
Angular js automation using protractorAngular js automation using protractor
Angular js automation using protractor
Ravi Gupta
 
What's new in selenium 4
What's new in selenium 4What's new in selenium 4
What's new in selenium 4
Knoldus Inc.
 
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
 
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
 
Tech talks (Automation on Selenium Web Driver. How to begin & implement)
Tech talks (Automation on Selenium Web Driver. How to begin & implement)Tech talks (Automation on Selenium Web Driver. How to begin & implement)
Tech talks (Automation on Selenium Web Driver. How to begin & implement)
Taras Lytvyn
 
Selenium
SeleniumSelenium
Selenium
mdiliyazm
 
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
 
Selenium WebDriver - Test automation for web applications
Selenium WebDriver - Test automation for web applicationsSelenium WebDriver - Test automation for web applications
Selenium WebDriver - Test automation for web applications
TSundberg
 
selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...
Nancy Thomas
 
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
 
Selenium Architecture
Selenium ArchitectureSelenium Architecture
Selenium Architecture
rohitnayak
 
Nakal think test_2015
Nakal think test_2015Nakal think test_2015
Nakal think test_2015
Rajdeep Varma
 
Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0
Steven Smith
 
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
SQALab
 
Selenium Tips & Tricks
Selenium Tips & TricksSelenium Tips & Tricks
Selenium Tips & Tricks
Dave Haeffner
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)Dave Haeffner
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
Sachin-QA
 

What's hot (20)

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
 
Automation using Javascript
Automation using JavascriptAutomation using Javascript
Automation using Javascript
 
Selenium topic 1- Selenium Basic
Selenium topic 1-  Selenium BasicSelenium topic 1-  Selenium Basic
Selenium topic 1- Selenium Basic
 
Angular js automation using protractor
Angular js automation using protractorAngular js automation using protractor
Angular js automation using protractor
 
What's new in selenium 4
What's new in selenium 4What's new in selenium 4
What's new in selenium 4
 
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
 
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
 
Tech talks (Automation on Selenium Web Driver. How to begin & implement)
Tech talks (Automation on Selenium Web Driver. How to begin & implement)Tech talks (Automation on Selenium Web Driver. How to begin & implement)
Tech talks (Automation on Selenium Web Driver. How to begin & implement)
 
Selenium
SeleniumSelenium
Selenium
 
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
 
Selenium WebDriver - Test automation for web applications
Selenium WebDriver - Test automation for web applicationsSelenium WebDriver - Test automation for web applications
Selenium WebDriver - Test automation for web applications
 
selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...
 
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
 
Selenium Architecture
Selenium ArchitectureSelenium Architecture
Selenium Architecture
 
Nakal think test_2015
Nakal think test_2015Nakal think test_2015
Nakal think test_2015
 
Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0Introducing ASP.NET Core 2.0
Introducing ASP.NET Core 2.0
 
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
 
Selenium Tips & Tricks
Selenium Tips & TricksSelenium Tips & Tricks
Selenium Tips & Tricks
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 

Viewers also liked

Protractor powerpoint
Protractor powerpointProtractor powerpoint
Protractor powerpoint
lindarousselle
 
Protractor: Tips & Tricks
Protractor: Tips & TricksProtractor: Tips & Tricks
Protractor: Tips & Tricks
Sergey Bolshchikov
 
Rex E2E
Rex E2ERex E2E
Bring stories to life using BDD (Behaviour driven development)
Bring stories to life using BDD (Behaviour driven development)Bring stories to life using BDD (Behaviour driven development)
Bring stories to life using BDD (Behaviour driven development)
Srikanth Nutigattu
 
Protractor
ProtractorProtractor
Protractor
kapilsethi9
 
Presentation_Protractor
Presentation_ProtractorPresentation_Protractor
Presentation_ProtractorUmesh Randhe
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
Jim Lynch
 
Apéro techno node.js + AngularJS @Omnilog 2014
Apéro techno node.js + AngularJS @Omnilog 2014Apéro techno node.js + AngularJS @Omnilog 2014
Apéro techno node.js + AngularJS @Omnilog 2014
Yves-Emmanuel Jutard
 
Octo Technology - Refcard Tests Web front-end
Octo Technology - Refcard Tests Web front-endOcto Technology - Refcard Tests Web front-end
Octo Technology - Refcard Tests Web front-end
François Petitit
 
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Codemotion
 
Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!
Julien Biezemans
 
Better End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorBetter End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using Protractor
Kasun Kodagoda
 
The LAZY Developer's Guide to BDD (with Cucumber)
The LAZY Developer's Guide to BDD (with Cucumber)The LAZY Developer's Guide to BDD (with Cucumber)
The LAZY Developer's Guide to BDD (with Cucumber)
Tze Yang Ng
 
Typescript ppt
Typescript pptTypescript ppt
Typescript ppt
akhilsreyas
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
Aniruddha Chakrabarti
 
Workshop - E2e tests with protractor
Workshop - E2e tests with protractorWorkshop - E2e tests with protractor
Workshop - E2e tests with protractor
Walmyr Lima e Silva Filho
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and Selenium
Dev9Com
 
Apresentação de Padrões de Design para Aplicativos Móveis.
Apresentação de Padrões de Design para Aplicativos Móveis.Apresentação de Padrões de Design para Aplicativos Móveis.
Apresentação de Padrões de Design para Aplicativos Móveis.
Hewerson Freitas
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
Jie-Wei Wu
 
Javascript test frameworks
Javascript test frameworksJavascript test frameworks
Javascript test frameworks
talkitbr
 

Viewers also liked (20)

Protractor powerpoint
Protractor powerpointProtractor powerpoint
Protractor powerpoint
 
Protractor: Tips & Tricks
Protractor: Tips & TricksProtractor: Tips & Tricks
Protractor: Tips & Tricks
 
Rex E2E
Rex E2ERex E2E
Rex E2E
 
Bring stories to life using BDD (Behaviour driven development)
Bring stories to life using BDD (Behaviour driven development)Bring stories to life using BDD (Behaviour driven development)
Bring stories to life using BDD (Behaviour driven development)
 
Protractor
ProtractorProtractor
Protractor
 
Presentation_Protractor
Presentation_ProtractorPresentation_Protractor
Presentation_Protractor
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
 
Apéro techno node.js + AngularJS @Omnilog 2014
Apéro techno node.js + AngularJS @Omnilog 2014Apéro techno node.js + AngularJS @Omnilog 2014
Apéro techno node.js + AngularJS @Omnilog 2014
 
Octo Technology - Refcard Tests Web front-end
Octo Technology - Refcard Tests Web front-endOcto Technology - Refcard Tests Web front-end
Octo Technology - Refcard Tests Web front-end
 
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
 
Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!Cucumber.js: Cuke up your JavaScript!
Cucumber.js: Cuke up your JavaScript!
 
Better End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorBetter End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using Protractor
 
The LAZY Developer's Guide to BDD (with Cucumber)
The LAZY Developer's Guide to BDD (with Cucumber)The LAZY Developer's Guide to BDD (with Cucumber)
The LAZY Developer's Guide to BDD (with Cucumber)
 
Typescript ppt
Typescript pptTypescript ppt
Typescript ppt
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
 
Workshop - E2e tests with protractor
Workshop - E2e tests with protractorWorkshop - E2e tests with protractor
Workshop - E2e tests with protractor
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and Selenium
 
Apresentação de Padrões de Design para Aplicativos Móveis.
Apresentação de Padrões de Design para Aplicativos Móveis.Apresentação de Padrões de Design para Aplicativos Móveis.
Apresentação de Padrões de Design para Aplicativos Móveis.
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
 
Javascript test frameworks
Javascript test frameworksJavascript test frameworks
Javascript test frameworks
 

Similar to ProtractorJS for automated testing of Angular 1.x/2.x applications

QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QAFest
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
Dhaval Barot
 
Automated ui-testing
Automated ui-testingAutomated ui-testing
Automated ui-testing
Slobodan Lohja
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
Pankaj Biswas
 
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and BackboneJavascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Deepu S Nath
 
Top java script frameworks ppt
Top java script frameworks pptTop java script frameworks ppt
Top java script frameworks ppt
Omkarsoft Bangalore
 
Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsAutomation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra Solutions
Quontra Solutions
 
Selenide
SelenideSelenide
Selenide
DataArt
 
Javascript Frameworks Comparison
Javascript Frameworks ComparisonJavascript Frameworks Comparison
Javascript Frameworks Comparison
Deepu S Nath
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN StackRob Davarnia
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
Rob Windsor
 
Web Test Automation Framework - IndicThreads Conference
Web Test Automation Framework  - IndicThreads ConferenceWeb Test Automation Framework  - IndicThreads Conference
Web Test Automation Framework - IndicThreads Conference
IndicThreads
 
Shifting landscape of mobile automation, and the future of Appium - Jonathan ...
Shifting landscape of mobile automation, and the future of Appium - Jonathan ...Shifting landscape of mobile automation, and the future of Appium - Jonathan ...
Shifting landscape of mobile automation, and the future of Appium - Jonathan ...
Applitools
 
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Atirek Gupta
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
orbitprojects
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
Amr E. Mohamed
 
Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Control
usha kannappan
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
Jibanananda Sana
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Ondřej Machulda
 

Similar to ProtractorJS for automated testing of Angular 1.x/2.x applications (20)

QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
QA Fes 2016. Александр Хотемской. Обзор ProtractorJS как фреймворка для брауз...
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
 
Automated ui-testing
Automated ui-testingAutomated ui-testing
Automated ui-testing
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and BackboneJavascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
 
Top java script frameworks ppt
Top java script frameworks pptTop java script frameworks ppt
Top java script frameworks ppt
 
Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsAutomation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra Solutions
 
Selenide
SelenideSelenide
Selenide
 
Javascript Frameworks Comparison
Javascript Frameworks ComparisonJavascript Frameworks Comparison
Javascript Frameworks Comparison
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
 
Web Test Automation Framework - IndicThreads Conference
Web Test Automation Framework  - IndicThreads ConferenceWeb Test Automation Framework  - IndicThreads Conference
Web Test Automation Framework - IndicThreads Conference
 
Shifting landscape of mobile automation, and the future of Appium - Jonathan ...
Shifting landscape of mobile automation, and the future of Appium - Jonathan ...Shifting landscape of mobile automation, and the future of Appium - Jonathan ...
Shifting landscape of mobile automation, and the future of Appium - Jonathan ...
 
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 
Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Control
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
 

More from Binary Studio

Academy PRO: D3, part 3
Academy PRO: D3, part 3Academy PRO: D3, part 3
Academy PRO: D3, part 3
Binary Studio
 
Academy PRO: D3, part 1
Academy PRO: D3, part 1Academy PRO: D3, part 1
Academy PRO: D3, part 1
Binary Studio
 
Academy PRO: Cryptography 3
Academy PRO: Cryptography 3Academy PRO: Cryptography 3
Academy PRO: Cryptography 3
Binary Studio
 
Academy PRO: Cryptography 1
Academy PRO: Cryptography 1Academy PRO: Cryptography 1
Academy PRO: Cryptography 1
Binary Studio
 
Academy PRO: Advanced React Ecosystem. MobX
Academy PRO: Advanced React Ecosystem. MobXAcademy PRO: Advanced React Ecosystem. MobX
Academy PRO: Advanced React Ecosystem. MobX
Binary Studio
 
Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4
Binary Studio
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
Binary Studio
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1
Binary Studio
 
Binary Studio Academy 2017: JS team project - Orderly
Binary Studio Academy 2017: JS team project - OrderlyBinary Studio Academy 2017: JS team project - Orderly
Binary Studio Academy 2017: JS team project - Orderly
Binary Studio
 
Binary Studio Academy 2017: .NET team project - Unicorn
Binary Studio Academy 2017: .NET team project - UnicornBinary Studio Academy 2017: .NET team project - Unicorn
Binary Studio Academy 2017: .NET team project - Unicorn
Binary Studio
 
Academy PRO: React native - miscellaneous
Academy PRO: React native - miscellaneousAcademy PRO: React native - miscellaneous
Academy PRO: React native - miscellaneous
Binary Studio
 
Academy PRO: React native - publish
Academy PRO: React native - publishAcademy PRO: React native - publish
Academy PRO: React native - publish
Binary Studio
 
Academy PRO: React native - navigation
Academy PRO: React native - navigationAcademy PRO: React native - navigation
Academy PRO: React native - navigation
Binary Studio
 
Academy PRO: React native - building first scenes
Academy PRO: React native - building first scenesAcademy PRO: React native - building first scenes
Academy PRO: React native - building first scenes
Binary Studio
 
Academy PRO: React Native - introduction
Academy PRO: React Native - introductionAcademy PRO: React Native - introduction
Academy PRO: React Native - introduction
Binary Studio
 
Academy PRO: Push notifications. Denis Beketsky
Academy PRO: Push notifications. Denis BeketskyAcademy PRO: Push notifications. Denis Beketsky
Academy PRO: Push notifications. Denis Beketsky
Binary Studio
 
Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4
Binary Studio
 
Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3
Binary Studio
 
Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2
Binary Studio
 
Academy PRO: Docker. Lecture 1
Academy PRO: Docker. Lecture 1Academy PRO: Docker. Lecture 1
Academy PRO: Docker. Lecture 1
Binary Studio
 

More from Binary Studio (20)

Academy PRO: D3, part 3
Academy PRO: D3, part 3Academy PRO: D3, part 3
Academy PRO: D3, part 3
 
Academy PRO: D3, part 1
Academy PRO: D3, part 1Academy PRO: D3, part 1
Academy PRO: D3, part 1
 
Academy PRO: Cryptography 3
Academy PRO: Cryptography 3Academy PRO: Cryptography 3
Academy PRO: Cryptography 3
 
Academy PRO: Cryptography 1
Academy PRO: Cryptography 1Academy PRO: Cryptography 1
Academy PRO: Cryptography 1
 
Academy PRO: Advanced React Ecosystem. MobX
Academy PRO: Advanced React Ecosystem. MobXAcademy PRO: Advanced React Ecosystem. MobX
Academy PRO: Advanced React Ecosystem. MobX
 
Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1
 
Binary Studio Academy 2017: JS team project - Orderly
Binary Studio Academy 2017: JS team project - OrderlyBinary Studio Academy 2017: JS team project - Orderly
Binary Studio Academy 2017: JS team project - Orderly
 
Binary Studio Academy 2017: .NET team project - Unicorn
Binary Studio Academy 2017: .NET team project - UnicornBinary Studio Academy 2017: .NET team project - Unicorn
Binary Studio Academy 2017: .NET team project - Unicorn
 
Academy PRO: React native - miscellaneous
Academy PRO: React native - miscellaneousAcademy PRO: React native - miscellaneous
Academy PRO: React native - miscellaneous
 
Academy PRO: React native - publish
Academy PRO: React native - publishAcademy PRO: React native - publish
Academy PRO: React native - publish
 
Academy PRO: React native - navigation
Academy PRO: React native - navigationAcademy PRO: React native - navigation
Academy PRO: React native - navigation
 
Academy PRO: React native - building first scenes
Academy PRO: React native - building first scenesAcademy PRO: React native - building first scenes
Academy PRO: React native - building first scenes
 
Academy PRO: React Native - introduction
Academy PRO: React Native - introductionAcademy PRO: React Native - introduction
Academy PRO: React Native - introduction
 
Academy PRO: Push notifications. Denis Beketsky
Academy PRO: Push notifications. Denis BeketskyAcademy PRO: Push notifications. Denis Beketsky
Academy PRO: Push notifications. Denis Beketsky
 
Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4
 
Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3
 
Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2Academy PRO: Docker. Lecture 2
Academy PRO: Docker. Lecture 2
 
Academy PRO: Docker. Lecture 1
Academy PRO: Docker. Lecture 1Academy PRO: Docker. Lecture 1
Academy PRO: Docker. Lecture 1
 

Recently uploaded

Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 

Recently uploaded (20)

Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 

ProtractorJS for automated testing of Angular 1.x/2.x applications

  • 1. Selenium WebDriverJS based framework for automated testing of Angular 1.x/2.x applications OLEKSANDR KHOTEMSKYI https://xotabu4.github.io/website
  • 2.  Julie Ralph(Google) is one of the main contributors, made first commits in January 2013  Created as an answer to question: ”How to make end to end tests for AngularJS applications easier?”  Now ProtractorJS reached version 4.x, with over 1300 commits, 5700 GitHub stars, 200 contributors
  • 3.
  • 4.  Easier than Java  Thousands of libraries already exist for JS/NodeJS. Friendly community, tons of open source code. Package manager already included in NodeJS  Much easier common code like JSON parsing, sending HTTP requests, and others  Duck-typing, monkey-patching  Tools are smaller, and project start is faster  Newest versions of TypeScript or ECMAScript 6 makes code much easier to write and understand  Same language for front-end, back-end and tests means that same code execution environment
  • 5.  JS is one of the most popular languages today, and TypeScript is as primary in Angular 2.0 https://dou.ua/lenta/articles/language-rating-jan-2016/ JAVA C# JavaScript PHP PythonC++ Ruby
  • 6.  Developed by Microsoft team  Superset of JavaScript (includes JavaScript)  Compiles to JavaScript (ECMAScript 3, 5 or 6)  Optional types! This allows to have autocomplete in IDE  Easier refactoring of code  Has features that not yet in JavaScript specification (@Annotations, async/await)  Compilation errors, instead of runtime errors in JavaScript
  • 7. ProtractorJS Java Selenium WebDriver High-level framework Low-level automation library (not framework) Uses script languages: TypeScript or JavaScript or both same time Uses Java JasimineJS (test runner and assertions), SauceLabs/BrowserStack integration, basic reporting, interactive debugger, command line parameters, configuration files  Node Package Manager shows ~628 results for ‘protractor’ Maven shows ~422 results for ‘selenium webdriver’ Asynchronous, uses own control-flow, and Promises objects Synchronous, traditional approach Ability to run tests in parallel Parallel running should be done with additional libraries/frameworks PageObjects are just objects with attributes and functions PageObjects require @FindBy annotations and PageObjectFactory usage. Plugins. Extra element locators. Mobile browsers support (with Appium). Mobile browsers support.
  • 8. Test Runner (JasmineJS, Cucumber …) ProtractorJS Selenium JavaScript official bindings NodeJS environment Test Runner extensions Selenium Standalone Server (JAVA) Other JS modules HTTP JSON ChromeDriver GeckoDriver EdgeDriver SafariDriver Other drivers
  • 9. • Runs on NodeJS 4.x, 5.x, 6.x • Can be used with different Test Runners (JasmineJS, CucumberJS, Mocha, others) • Can connect to browser using WebDriver server or directly (Chrome and Firefox only) • Supports all browsers that WebDriver does: Chrome, Firefox, Edge, Safari, Opera, PhantomJS and mobile • Angular 1.x and Angular 2.x ready!
  • 10. One of the key features of ProtractorJS that it is uses same JSON WebDriver Wire protocol as other language bindings. This code will be executed as 3 separate JSON WebDriver Wire Protocol commands: Synchronizing with AngularJS application Locating element on the page Sending ‘click’ action for element
  • 11. • Protractor uses ‘Wrapper’ pattern to add own features to standard WebDriver, WebElement, Locators objects Browser(WebDriver instance) + Inherited from WebDriver • getProcessedConfig • forkNewDriverInstance • restart • useAllAngular2AppRoots • waitForAngular • findElement • findElements • isElementPresent • addMockModule • clearMockModules • removeMockModule • getRegisteredMockModules • get • refresh • navigate • setLocation • getLocationAbsUrl • debugger • enterRepl • pause • wrapDriver actions touchActions executeScript executeAsyncScri pt call wait sleep getPageSource close getCurrentUrl getTitle takeScreenshot switchTo
  • 12. ElementFinder + Inherited from WebElement• then • clone • locator • getWebElement • all • element • $$ • $ • isPresent • isElementPresent • evaluate • allowAnimations • equals • getDriver • getId • getRawId • serialize • findElement • click • sendKeys • getTagName • getCssValue • getAttribute • getText • getSize • getLocation • isEnabled • isSelected • submit • clear • isDisplayed • takeScreenshot
  • 13. Protractor Locators + Inherited from WebDriver Locators• addLocator • binding • exactBinding • model • buttonText • partialButtonText • repeater • exactRepeater • cssContainingText • options • deepCss • className • css • id • linkText • js • name • partialLinkText • tagName • xpath
  • 14.
  • 15.  JavaScript is single threaded (mostly)  To have possibility to do multiple tasks at once – JavaScript run them all in single thread, and quickly switch between them  Async tasks are running in isolation. To make execution step by step – callbacks are used  Callbacks are just functions, that will be called when async function is finished. It is like – “call this when you are done”. You can pass any arguments to them
  • 16.
  • 17.
  • 18.  Pattern to avoid callback hell, extension of callbacks  Almost every function from API returns special object – Promise  Promise is a object, that will be resolved to a value (any), or rejected if value can’t be returned
  • 19.
  • 20.  Do not try to write in synchronous manner! You should think differently when writing async code  When you asserting results – promises automatically resolved. Do not worry to resolve promise before assertion  To wait something on the page – use browser.wait() or browser.sleep()  ES7 features are on their way! async/await will make our life much easier  Be brave and good luck
  • 21.
  • 22. https://gist.github.com/Xotabu4/f26afb9e24397c9d059bb984d30a6b0a Example of simple test case JAVA + Pure Selenium JAVA + JUNIT TypeScript + ProtractorJS + JasmineJS https://gist.github.com/Xotabu4/dcfe83bc98ad304f58f3b05de9cd6c69
  • 23. https://gist.github.com/Xotabu4/79ece1d104f2557a70cd079b62f46f45 Example of simple pageObject pattern usage JAVA + Selenium PageObjectFactory (@FindBy) TypeScript + ProtractorJS https://gist.github.com/Xotabu4/a9334f22933d1d6a16c820ccb4bd6635
  • 25. And useful links:  Protractor site: http://www.protractortest.org  Promises, WebDriver Control Flow documentation: http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium- webdriver/lib/promise.html  Gitter chat: https://gitter.im/angular/protractor  StackOverflow(top questions): http://stackoverflow.com/questions/tagged/protractor?sort=votes&pageSize=20  GitHub: https://github.com/angular/protractor  TypeScript documentation: https://www.typescriptlang.org/docs/tutorial.html  ES6 features: http://es6-features.org/  Protractor TypeScript example: https://github.com/angular/protractor/tree/master/exampleTypescript OLEKSANDR KHOTEMSKYI https://xotabu4.github.io/website 2016

Editor's Notes

  1. Последняя 4.4
  2. Мое мнение – для новых проектов использовать уже TypeScript, старые можно частично мигрировать на TypeScript, или оставить как есть. ПОКАЖИ ВИДЕО!!!
  3. Здесь важно сказать что протрактор работает по точно такому же протоколу как и Java bindings. То есть в браузере разницы видно не будет. + javascript бингинги официальные, и поддерживаются практически наравне с джавашными и остальными. WebDriver wire protocol
  4. Protractor element EXTENDS WebDriverJS element, so all functions are accessible.
  5. Here is exampe of simple Protractor interaction with the page: First, Protractor tells the browser to run a snippet of JavaScript. This is a custom command which asks Angular to respond when the application is done with all timeouts and asynchronous requests, and ready for the test to resume. Then, the command to find the element is sent. Finally the command to perform a click action is sent. Summary: Protractor uses the same API to manipulate browser as any other language bindings, so browser won’t notice any difference here
  6. Protractor element EXTENDS WebDriverJS element, so all functions are accessible.
  7. Protractor element EXTENDS WebDriverJS element, so all functions are accessible.
  8. ProtractorBy.prototype.deepCss - Find an element by css selector within the Shadow DOM. ProtractorBy.prototype.options - Find an element by ng-options expression.
  9. Тут рассказать про асинхронность и контрол флоу Больше всего у людей которые начинают переходить в мир JS взрывает мозг именно асинхронность. Попытаемся рассказать основные моменты
  10. Это вернет Promise, который станет или текущим именем пользователя, или пустой строкой, в случае если такого элемента не существует.
  11. Explicit creating and closing of browser is needed
  12. Explicit creating and closing of browser is needed