SlideShare a Scribd company logo
@vibranttester | @wswebcreation
Build a Responsive
TypeScript WebdriverIO
Framework
Varuna Srivastava Lead Quality Analyst @ThoughtWorks
Wim Selles Sr. Solutions Architect @Sauce Labs
@vibranttester | @wswebcreation
Agenda
Node.js
NPM
WebdriverIO
TypeScript
Demo
2
@vibranttester | @wswebcreation
Node.js
3
@vibranttester | @wswebcreation
Node.js - What it’s NOT!
!!PROGRAMMING LANGUAGE!!
4
@vibranttester | @wswebcreation
Node.js - What is it!
Node is an open source cross platform
runtime environment for JavaScript outside of
a browser, based on Chrome’s V8 Engine.
5
@vibranttester | @wswebcreation
Node.js
6
● Founded in 2009
● Chrome's V8 Engine
● Node.js evolved rapidly
● Build whatever you want
○ Complex websites
○ Mobile apps
○ Desktop apps
@vibranttester | @wswebcreation
Node.js
7
● Founded in 2009
● Chrome's V8 Engine
● Node.js evolved rapidly
● Build whatever you want
○ Complex websites
○ Mobile apps
○ Desktop apps
@vibranttester | @wswebcreation
Node.js
8
● Founded in 2009
● Chrome's V8 Engine
● Node.js evolved rapidly
● Build whatever you want
○ Complex websites
○ Mobile apps
○ Desktop apps
● 2010: Express
● 2011:
○ npm 1.0 released
○ LinkedIn, Uber,.. adopt Node.js
● 2012-2014: lots of improvements
● 2015:
○ Node.js Foundation is born
○ ES6 support
○ Private modules
○ Yarn is born
● 2016-now: 📈
@vibranttester | @wswebcreation
Node.js
9
● Founded in 2009
● Chrome's V8 Engine
● Node.js evolved rapidly
● Build whatever you want
○ Complex websites
○ Mobile apps
○ Desktop apps
@vibranttester | @wswebcreation
Node.js
10
● Founded in 2009
● Chrome's V8 Engine
● Node.js evolved rapidly
● Build whatever you want
○ Complex websites
○ Mobile apps
○ Desktop apps
@vibranttester | @wswebcreation
Node.js
11
● Founded in 2009
● Chrome's V8 Engine
● Node.js evolved rapidly
● Build whatever you want
○ Complex websites
○ Mobile apps
○ Desktop apps
@vibranttester | @wswebcreation
Java vs JavaScript
● Syntax
● Strongly typed versus weakly typed
● Server side compiled versus client side interpreted
● Synchronous versus asynchronous
12
@vibranttester | @wswebcreation
Synchronous
Handle one
blocking request
on a single thread.
13
Single Thread
(Kitchen)
Request
(Table)
2
Request
(Table)
1
@vibranttester | @wswebcreation
Asynchronous
Handle multiple non-blocking
requests
on a single thread.
14
Single Thread
(Kitchen)
Request
(Table)
2
Request
(Table)
1
@vibranttester | @wswebcreation
Promises
15
A promise is an object which can be
returned synchronously from an
asynchronous function. It will be in
one of the 3 possible states
● Pending
● FulïŹlled
● Rejected
@vibranttester | @wswebcreation
Promises
16
A promise is an object which can be
returned synchronously from an
asynchronous function. It will be in
one of the 3 possible states
● Pending
● FulïŹlled
● Rejected
@vibranttester | @wswebcreation
(A)synchronous
17
● Synchronous (Java) code
● Native promises
● Multiple promises
● Async await
@vibranttester | @wswebcreation
(A)synchronous
18
● Synchronous (Java) code
● Native promises
● Multiple promises
● Async await
@vibranttester | @wswebcreation
(A)synchronous
19
● Synchronous (Java) code
● Native promises
● Multiple promises
● Async await
@vibranttester | @wswebcreation
(A)synchronous
20
● Synchronous (Java) code
● Native promises
● Multiple promises
● Async await
@vibranttester | @wswebcreation
NPM
21
@vibranttester | @wswebcreation
NPM
22
Node Package Manager:
● The website
● A command Line Interface
● A registry where all packages
are stored
@vibranttester | @wswebcreation
NPM
23
Node Package Manager:
● The website
● A command Line Interface
● A registry where all packages
are stored
@vibranttester | @wswebcreation
NPM
24
Node Package Manager:
● The website
● A command Line Interface
● A registry where all packages
are stored
@vibranttester | @wswebcreation
Package
25
A package is a project/collection
of 1 or multiple
{node_modules}
which have a speciïŹc task as
described in the
{package.json}-ïŹle.
@vibranttester | @wswebcreation
WebdriverIO
26
@vibranttester | @wswebcreation
WebDriver Protocol
WebDriver is a remote control interface
that enables introspection and control of
user agents.
27
@vibranttester | @wswebcreation
28
@vibranttester | @wswebcreation
29
const elem = $("#myElem")
elem.click()
Chromedriver
Geckodriver
IEDriver
EdgeDriver
SafariDriver
Appium
Selendroid
WebDriverAgent
HTTP
Selenium Grid
@vibranttester | @wswebcreation
Key Features
Easy setup
30
@vibranttester | @wswebcreation
Key Features
Async mode
31
@vibranttester | @wswebcreation
Key Features
Sync mode
32
@vibranttester | @wswebcreation
Key Features
Easy Integration
33
@vibranttester | @wswebcreation
Key Features
Multi Remote
34
Normal Test
Result
Test File
Multiremote Test
Result
...
Test File
@vibranttester | @wswebcreation
Key Features
Online Tutorials
35
@vibranttester | @wswebcreation
Key Features
Online
Community
36
@vibranttester | @wswebcreation
Key Features
Part of the
OpenJS
Foundation
37
❀
@vibranttester | @wswebcreation
WebdriverIO - 3 different tastes
38
Standalone Mode
Simply consume the
module as a NPM-package
within a normal JS-ïŹle
WDIO Testrunner
Using the testrunner
capabilities you can easily
run tests in parallel
import {remote} from ‘webdriverio’
const client = remote({
capabilities: { ... }
})
$ wdio wdio.conf.js
Bare Metal Mode
Interface to directly talk
to the underlying
protocol:
import WebDriver from 'webdriver'
const client = await WebDriver
.newSession({
capabilities: {
browserName: 'firefox'
}
})
@vibranttester | @wswebcreation
WebdriverIO - Different Test Frameworks
39
@vibranttester | @wswebcreation
Plugins
&
Extensions
40
Reporter
● Spec
● Dot
● Allure
● JUnit
● TeamCity
● Tap
● Mochaawesome
● ...
Services
● Sauce
● Appium
● Static Server
● Chromedriver
● Selenium Standalone
● Docker
● ...
@vibranttester | @wswebcreation
WebdriverIO - Custom Commands
41
Great way to wrap any custom (async) logic into a command:
browser.addCommand('deleteUser', (username) => {
return axios.post(
'/rest/v1/_test_helpers/delete_user',
{ user: username }
);
});
browser.deleteUser('anonymous123')
browser.url('/dashboard')
// ...
@vibranttester | @wswebcreation
WebdriverIO - Select elements
42
Element with certain text
const header = $('h1=Welcome to my Page');
const header2 = $('h1*=Welcome');
CSS Query Selector
const elem = $('h2.subheading a');
elem.click();
Link Text
<!-- index.html -->
<a href="http://webdriver.io">WebdriverIO</a>
<h1>Welcome to my Page</h1>
// test.js
const link = $('=WebdriverIO');
console.log(link.getText()); // outputs: "WebdriverIO"
Partial Link Text
const link = $('*=driver');
console.log(link.getText()); // outputs: "WebdriverIO"
XPath
const elem = $('//BODY/P[1]');
elem.click();
@vibranttester | @wswebcreation
WebdriverIO - Select elements
43
React.JS Support
<!-- my-component.jsx -->
import React from 'react'
import ReactDOM from 'react-dom'
const MyComponent = (props) => {
const { name } = props;
const [state] = React.useState(name === 'there'
? ', how are you?' : '')
return (<div>Hello {name || 'World'}{state}</div>)
}
ReactDOM.render(
<div>
<MyComponent />
<MyComponent name="Barry"/>
<MyComponent name="WebdriverIO"/>
<MyComponent name="there"/>
</div>,
document.getElementById('#root'),
)
// test.js
const myComponent = browser.react$('MyComponent')
expect(myComponent.isDisplayed()).toBe(true) // pass
const myComponent = browser.react$('MyComponent', {name: 'WebdriverIO'})
expect(myComponent.getText()).toBe('Hello WebdriverIO') // pass
const myComponent = browser.react$('MyComponent', {}, ', how are you?')
expect(myComponent.getText()).toBe('Hello there, how are you?') // pass
@vibranttester | @wswebcreation
WebdriverIO - Select elements with Appium
44
Accessibility ID
const elem = $('~my_identifier');
elem.click();
Class Chain (iOS)
const selector = '**/XCUIElementTypeCell[`name BEGINSWITH "D"`]/**/XCUIElementTypeButton';
const Button = $(`-ios class chain:${selector}`);
Button.click();
Class Name
// iOS example
$('UIATextField').click();
// Android example
$('android.widget.DatePicker').click();
UI Automator (Android)
const selector = 'new UiSelector().text("Cancel").className("android.widget.Button")';
const Button = $(`android=${selector}`);
Button.click();
@vibranttester | @wswebcreation
Dive into TypeScript
@vibranttester | @wswebcreation
TypeScript - What is it!
TypeScript is a typed superset of JavaScript
that compiles to plain JavaScript
46
@vibranttester | @wswebcreation
TypeScript - What is it!
47
@vibranttester | @wswebcreation
TypeScript - What is it!
48
Compiled to
@vibranttester | @wswebcreation
49
● 2012: v0.8
● 2013:
○ V0.9 released
○ Support for Generic
● 2014:
○ New compiler was released
○ 5x performance gain
● 2016:
○ Prevent variables from been assigned
○ Control ïŹ‚ow analysis errors
● 2016-2020: 📈
● 2020: v4.0
○ Short circuit assignment operator
○ Speed improvements in build
--no-emit
TypeScript
Launched
in 2012
@vibranttester | @wswebcreation
TypeScript vs JavaScript
● Compile time versus Runtime error
● Strongly typed versus weakly typed
● Support modules, generic, interface versus no support
50
@vibranttester | @wswebcreation
TypeScript vs
JavaScript
51
● Runtime error vs Compile time
● Dynamic Type vs Static Type
● Interface
@vibranttester | @wswebcreation
TypeScript vs
JavaScript
52
● Runtime error vs Compile time
● Dynamic Type vs Static Type
● Interface
@vibranttester | @wswebcreation
TypeScript vs
JavaScript
53
● Runtime error vs Compile time
● Dynamic Type vs Static Type
● Interface vs no support
@vibranttester | @wswebcreation
54
Getting Started
https://github.com/varunatester/sel-workshop
@vibranttester | @wswebcreation
Getting started
55
● The tsconïŹg.json ïŹle
● Know the Type Inference
whatever you want
○ Complex websites
○ Mobile apps
○ Desktop apps
@vibranttester | @wswebcreation
Getting started
56
● The tsconïŹg.json ïŹle
● Know the Type Inference
whatever you want
○ Complex websites
○ Mobile apps
○ Desktop apps
@vibranttester | @wswebcreation
● Quick set up
● Write a basic test
● Refactor a test using page object
model
● Integrate with allure report
Demo
57
@vibranttester | @wswebcreation
● https://github.com/varunatester/
sel-workshop
● https://www.typescriptlang.org/
● https://nodejs.org/en/
References
58
@vibranttester | @wswebcreation
Thank you!

More Related Content

PDF
React Native AndroidはăȘぜ拕くぼか
PDF
Tellurium.A.New.Approach.For.Web.Testing.V5
PPTX
ĐœĐžŃ…Đ°ĐžĐ» Đ‘ĐŸĐŽĐœĐ°Ń€Ń‡ŃƒĐș "Acceptance Testing in NodeJS: Tools & Approaches"
 
PDF
民しćčžă›ă«ăȘă‚‹æŠ€èĄ“
PPTX
Combining Angular and React Together
PDF
Automation Abstraction Layers: Page Objects and Beyond
PDF
React Nativeはクロă‚čăƒ—ăƒ©ăƒƒăƒˆăƒ•ă‚©ăƒŒăƒ ăƒąăƒă‚€ăƒ«ă‚ąăƒ—ăƒȘ開ç™șăźć€ąă‚’èŠ‹ă‚‹ă‹ #DroidKaigi
PDF
Page Objects Done Right - selenium conference 2014
React Native AndroidはăȘぜ拕くぼか
Tellurium.A.New.Approach.For.Web.Testing.V5
ĐœĐžŃ…Đ°ĐžĐ» Đ‘ĐŸĐŽĐœĐ°Ń€Ń‡ŃƒĐș "Acceptance Testing in NodeJS: Tools & Approaches"
 
民しćčžă›ă«ăȘă‚‹æŠ€èĄ“
Combining Angular and React Together
Automation Abstraction Layers: Page Objects and Beyond
React Nativeはクロă‚čăƒ—ăƒ©ăƒƒăƒˆăƒ•ă‚©ăƒŒăƒ ăƒąăƒă‚€ăƒ«ă‚ąăƒ—ăƒȘ開ç™șăźć€ąă‚’èŠ‹ă‚‹ă‹ #DroidKaigi
Page Objects Done Right - selenium conference 2014

What's hot (20)

PPTX
Angular 2 ì–Žë””êčŒì§€ 왔을êčŒ
PDF
Using ReactJS in AngularJS
PDF
Philip Shurpik "Architecting React Native app"
 
PDF
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
PPTX
The Screenplay Pattern: Better Interactions for Better Automation
PDF
The Gist of React Native
PPTX
Protractor framework – how to make stable e2e tests for Angular applications
PPTX
Testing frontends with nightwatch & saucelabs
PDF
React Facebook JavaScript Library
PDF
The Road to Native Web Components
PDF
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
PDF
Angular js vs. Facebook react
 
PDF
Make XCUITest Great Again
PDF
Test automation & Seleniun by oren rubin
KEY
Kirin - Making Single Page Web Apps with a Native UI
ODP
RichFaces - Testing on Mobile Devices
PPT
A journey beyond the page object pattern
PDF
Building a js widget
PPTX
Test-Driven JavaScript Development (JavaZone 2010)
PPTX
Javascript Best Practices and Intro to Titanium
Angular 2 ì–Žë””êčŒì§€ 왔을êčŒ
Using ReactJS in AngularJS
Philip Shurpik "Architecting React Native app"
 
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
The Screenplay Pattern: Better Interactions for Better Automation
The Gist of React Native
Protractor framework – how to make stable e2e tests for Angular applications
Testing frontends with nightwatch & saucelabs
React Facebook JavaScript Library
The Road to Native Web Components
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Angular js vs. Facebook react
 
Make XCUITest Great Again
Test automation & Seleniun by oren rubin
Kirin - Making Single Page Web Apps with a Native UI
RichFaces - Testing on Mobile Devices
A journey beyond the page object pattern
Building a js widget
Test-Driven JavaScript Development (JavaZone 2010)
Javascript Best Practices and Intro to Titanium
Ad

Similar to Builda responsivetypescriptwebdriverio framework (20)

PDF
Node.JS: Do you know the dependency of your dependencies dependency
PDF
Node.js and Selenium Webdriver, a journey from the Java side
PDF
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
PDF
Handson Selenium Webdriver With Java A Deep Dive Into The Development Of Endt...
PDF
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
PDF
Selenium documentation,
PDF
WebDriverIO Tutorial for Selenium Automation.pdf
PDF
HTML5 features & JavaScript APIs
PDF
Fullstack End-to-end test automation with Node.js, one year later
PDF
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
PPTX
Using JavaScript to Build HTML5 Tools (Ian Maffett)
DOCX
Brad Enterprise Solution Architect
PPTX
You got your browser in my virtual machine
PPT
Node and Azure
PDF
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
PDF
A Introduction to the World of Node, Javascript & Selenium
PDF
Learning Nodejs For Net Developers Harry Cummings
PPTX
AFTAB AHMED.pptx
PDF
My Test Automation Journey
PDF
New Features Coming in Browsers (RIT '09)
Node.JS: Do you know the dependency of your dependencies dependency
Node.js and Selenium Webdriver, a journey from the Java side
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
Handson Selenium Webdriver With Java A Deep Dive Into The Development Of Endt...
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
Selenium documentation,
WebDriverIO Tutorial for Selenium Automation.pdf
HTML5 features & JavaScript APIs
Fullstack End-to-end test automation with Node.js, one year later
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Using JavaScript to Build HTML5 Tools (Ian Maffett)
Brad Enterprise Solution Architect
You got your browser in my virtual machine
Node and Azure
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
A Introduction to the World of Node, Javascript & Selenium
Learning Nodejs For Net Developers Harry Cummings
AFTAB AHMED.pptx
My Test Automation Journey
New Features Coming in Browsers (RIT '09)
Ad

More from Wim Selles (7)

PDF
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
PDF
Building Your Own Native App Visual Testing Module with Appium
PDF
Building Your Own Native App Visual Testing Module with Appium
PDF
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
PDF
How React Native Appium and me made each other shine
PDF
Testing beyond the default click-paths
PDF
Why the h# should I use Appium with React Native
How React Native, Appium and me made each other shine @ContinuousDeliveryAmst...
Building Your Own Native App Visual Testing Module with Appium
Building Your Own Native App Visual Testing Module with Appium
How React Native, Appium and me made each other shine @Frontmania 16-11-2018
How React Native Appium and me made each other shine
Testing beyond the default click-paths
Why the h# should I use Appium with React Native

Recently uploaded (20)

PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
System and Network Administraation Chapter 3
PDF
System and Network Administration Chapter 2
PPTX
L1 - Introduction to python Backend.pptx
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Nekopoi APK 2025 free lastest update
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
medical staffing services at VALiNTRY
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
top salesforce developer skills in 2025.pdf
PPTX
Introduction to Artificial Intelligence
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Design an Analysis of Algorithms II-SECS-1021-03
System and Network Administraation Chapter 3
System and Network Administration Chapter 2
L1 - Introduction to python Backend.pptx
Understanding Forklifts - TECH EHS Solution
Computer Software and OS of computer science of grade 11.pptx
Wondershare Filmora 15 Crack With Activation Key [2025
Nekopoi APK 2025 free lastest update
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Operating system designcfffgfgggggggvggggggggg
medical staffing services at VALiNTRY
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
CHAPTER 2 - PM Management and IT Context
top salesforce developer skills in 2025.pdf
Introduction to Artificial Intelligence
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Navsoft: AI-Powered Business Solutions & Custom Software Development
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf

Builda responsivetypescriptwebdriverio framework