TaikoTaiko
Reliable Browser AutomationReliable Browser Automation
Harmeet Singh & Divya RakhianiHarmeet Singh & Divya Rakhiani
Slide 1Slide 1
Harmeet Singh
Senior Consultant
harmeets@thoughtworks.com
@ErHarmeet
hrmeetsingh
Divya Rakhiani
Senior Consultant
rdivya@thoughtworks.com
rakhid
Slide 2
Issues with Web Automation
Slow
Flaky
Complicated setup
Automation QAs Nightmares
Stale element exception
Cannot nd element
Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms
Slide 3
Web Automation
How Selenium works
Slide 4
Web Automation
How ChromeDevtools works
Slide 5
XHR and AJAX - Source of akiness
Slide 6
Introducing Taiko
Slide 7
Not this Taiko
Slide 8
What is it then?
Slide 9
What is it? Open source browser automation tool
An npm library
Built on Chrome DevTools API
Inspired by Helium and Puppeteer
Integration with test runners like Jest,
Jasmine and Gauge
Provides REPL
Free to use and extend
Slide 10
What is it?
Who built it?
The team behind Gauge by
ThoughtWorks
A growing community of Devs and
QAs
Slide 11
What is it?
Who built it?
Key features
Smart selectors
Ability to handle XHR and dynamic
content
Request/Response stubbing and
mocking
Interactive Recorder
Slide 12
InstallationInstallation
Slide 13Slide 13
Installing globally
npm install -g taiko
Adding to a javascript project
npm add taiko --save-dev
or, if using yarn
yarn add taiko --dev
yarn and npm are the most widely used package managers for JavaScript
Slide 14
The First Interaction
Launching interactive recorder
taiko
Getting help regarding the APIs
.api
Browser actions
openBrowser, closeBrowser, client, switchTo, openTab, closeTab
Page actions
goto, reload, title, click, doubleClick, rightClick, dragAndDrop
...
Getting help on particular function
.api openBrowser
Launches a browser with a tab.
The browser will be closed when the parent node.js process is closed.
...
Slide 15
FeaturesFeatures
Slide 16Slide 16
Smart Selectors
Click on a button by its text
click("Google Search")
Write into a field with default focus
write("taiko test automation")
Using proximity
click(checkbox(near("Username")))
Be specific where to locate element
write("something", into(textField({placeholder: "Username"})))
Using XPaths
click($("//input[name=`button_name`]"))
Slide 17
XHR and Dynamic Content Handling
Reduce flackiness by relying on page events rather than explicit waits
Waiting for page to load meaningful content
goto(`https://pagethatloadsdynamic.com`, {timeout: 10000,
waitForEvents: ["firstMeaningfulPaint", "firstContentfulPaint"]
})
Other options for events to wait for -
DOMContentLoaded
loadEventFired
networkAlmostIdle
networkIdle
firstPaint
firstContentfulPaint
firstMeaningfulPaint
Slide 18
Request Stubbing and Mocking
Blocking network requests
intercept("https://www.google-analytics.com/analytics.js")
Redirection
intercept("https://fetchdata.com", "http://fetchtestdata.com")
Stubbing
intercept("https://fetchdata.com", {"test": data })
Request modification
intercept("https://fetchdata.com", (request) =>
{request.continue({"custom": "data"})}))
Slide 19
Other Interesting Stu
Geolocation Mocking
overridePermissions("https://test.com/geolocation",['geolocation'])
setLocation({ latitude: 27.1752868, longitude: 78.040009, accuracy:20 })
Emulate network
emulateNetwork("WiFi")
Emulate device
emulateDevice('iPhone 6')
Set Cookies
setCookie("CSRFToken","csrfToken", {url: "http://test.com"})
Slide 20
The "Hello World" of Taiko
openBrowser()
goto("google.com")
write("taiko test automation")
click("Google Search")
Getting the recorded code
.code
const { openBrowser, goto, write, click } = require('taiko');
(async () => {
try {
await openBrowser();
await goto("google.com");
await write("taiko test automation");
await click("Google Search");
} catch (e) {
console.error(e);
} finally {
closeBrowser();
}
})();
Slide 21
Installation with GaugeInstallation with Gauge
Slide 22Slide 22
Free and open source test automation framework by ThoughtWorks
Recommended test runner for Taiko
Slide 23
Installing Gauge
npm install @getgauge/cli
Initializing a Taiko project
gauge init js
Create a Step Implementation
.step("When I search for taiko", async () => {
try {
await openBrowser();
await goto("google.com");
await write("taiko test automation");
await click("Google Search");
} catch (e) {
console.error(e);
} finally {
closeBrowser();
}
});
Slide 24
DEMO
Slide 25
Questions???Questions???
Slide 26Slide 26
Slide 27

More Related Content

PDF
Configuration of sap net weaver for oracle grid infrastructure 11.2 with orac...
PPTX
Api Testing
PPTX
Nextjs13.pptx
PPTX
NATS for Modern Messaging and Microservices
PDF
Taking Laravel to the edge with HTTP caching and Varnish
PPTX
Manage React State with Recoil
PDF
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육
PPTX
How we can measure server performance using jmeter?
Configuration of sap net weaver for oracle grid infrastructure 11.2 with orac...
Api Testing
Nextjs13.pptx
NATS for Modern Messaging and Microservices
Taking Laravel to the edge with HTTP caching and Varnish
Manage React State with Recoil
[오픈소스컨설팅] Ansible을 활용한 운영 자동화 교육
How we can measure server performance using jmeter?

Similar to Taiko - Reliable Browser Automation (20)

PPTX
Taiko_Gauge_PPT
PDF
vodQA Pune (2019) - Browser automation using dev tools
PPTX
Solving the Automation Puzzle - how to select the right automation framework ...
PPTX
Headless browser: puppeteer and git client : GitKraken
PDF
Node.js and Selenium Webdriver, a journey from the Java side
PPTX
Selenium ~ Uncommon but practical use cases
PDF
Webdriver.io
PPTX
TWISummit 2019 - Take the Pain out of Browser Automation!
PDF
Webdriver.io
PDF
Your Framework for Success: introduction to JavaScript Testing at Scale
PPTX
APIs for Browser Automation (MoT Meetup 2024)
PPTX
TestCafe Meetup Malmberg
PPTX
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
PPTX
Chrome extensions
PPTX
UI Automation Quirks
PPTX
Web Automation Testing for developers?
PPTX
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
PDF
Future of Mobile Web - Coldfront conf
PDF
Test Automation at the Speed of Agile: Making It Work Every Build
PDF
Test Automation for Packaged Systems: Yes, You Can!
Taiko_Gauge_PPT
vodQA Pune (2019) - Browser automation using dev tools
Solving the Automation Puzzle - how to select the right automation framework ...
Headless browser: puppeteer and git client : GitKraken
Node.js and Selenium Webdriver, a journey from the Java side
Selenium ~ Uncommon but practical use cases
Webdriver.io
TWISummit 2019 - Take the Pain out of Browser Automation!
Webdriver.io
Your Framework for Success: introduction to JavaScript Testing at Scale
APIs for Browser Automation (MoT Meetup 2024)
TestCafe Meetup Malmberg
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
Chrome extensions
UI Automation Quirks
Web Automation Testing for developers?
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Future of Mobile Web - Coldfront conf
Test Automation at the Speed of Agile: Making It Work Every Build
Test Automation for Packaged Systems: Yes, You Can!
Ad

Recently uploaded (20)

PDF
E-Commerce Website Development Companyin india
PDF
Visual explanation of Dijkstra's Algorithm using Python
PDF
Type Class Derivation in Scala 3 - Jose Luis Pintado Barbero
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PDF
Guide to Food Delivery App Development.pdf
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PDF
Practical Indispensable Project Management Tips for Delivering Successful Exp...
PPTX
Airline CRS | Airline CRS Systems | CRS System
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
PPTX
most interesting chapter in the world ppt
PDF
AI Guide for Business Growth - Arna Softech
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
DOC
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
E-Commerce Website Development Companyin india
Visual explanation of Dijkstra's Algorithm using Python
Type Class Derivation in Scala 3 - Jose Luis Pintado Barbero
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
BoxLang Dynamic AWS Lambda - Japan Edition
Topaz Photo AI Crack New Download (Latest 2025)
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
Guide to Food Delivery App Development.pdf
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
Practical Indispensable Project Management Tips for Delivering Successful Exp...
Airline CRS | Airline CRS Systems | CRS System
Full-Stack Developer Courses That Actually Land You Jobs
most interesting chapter in the world ppt
AI Guide for Business Growth - Arna Softech
MCP Security Tutorial - Beginner to Advanced
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
How to Use SharePoint as an ISO-Compliant Document Management System
Ad

Taiko - Reliable Browser Automation

  • 1. TaikoTaiko Reliable Browser AutomationReliable Browser Automation Harmeet Singh & Divya RakhianiHarmeet Singh & Divya Rakhiani Slide 1Slide 1
  • 3. Issues with Web Automation Slow Flaky Complicated setup Automation QAs Nightmares Stale element exception Cannot nd element Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms Slide 3
  • 6. XHR and AJAX - Source of akiness Slide 6
  • 9. What is it then? Slide 9
  • 10. What is it? Open source browser automation tool An npm library Built on Chrome DevTools API Inspired by Helium and Puppeteer Integration with test runners like Jest, Jasmine and Gauge Provides REPL Free to use and extend Slide 10
  • 11. What is it? Who built it? The team behind Gauge by ThoughtWorks A growing community of Devs and QAs Slide 11
  • 12. What is it? Who built it? Key features Smart selectors Ability to handle XHR and dynamic content Request/Response stubbing and mocking Interactive Recorder Slide 12
  • 14. Installing globally npm install -g taiko Adding to a javascript project npm add taiko --save-dev or, if using yarn yarn add taiko --dev yarn and npm are the most widely used package managers for JavaScript Slide 14
  • 15. The First Interaction Launching interactive recorder taiko Getting help regarding the APIs .api Browser actions openBrowser, closeBrowser, client, switchTo, openTab, closeTab Page actions goto, reload, title, click, doubleClick, rightClick, dragAndDrop ... Getting help on particular function .api openBrowser Launches a browser with a tab. The browser will be closed when the parent node.js process is closed. ... Slide 15
  • 17. Smart Selectors Click on a button by its text click("Google Search") Write into a field with default focus write("taiko test automation") Using proximity click(checkbox(near("Username"))) Be specific where to locate element write("something", into(textField({placeholder: "Username"}))) Using XPaths click($("//input[name=`button_name`]")) Slide 17
  • 18. XHR and Dynamic Content Handling Reduce flackiness by relying on page events rather than explicit waits Waiting for page to load meaningful content goto(`https://pagethatloadsdynamic.com`, {timeout: 10000, waitForEvents: ["firstMeaningfulPaint", "firstContentfulPaint"] }) Other options for events to wait for - DOMContentLoaded loadEventFired networkAlmostIdle networkIdle firstPaint firstContentfulPaint firstMeaningfulPaint Slide 18
  • 19. Request Stubbing and Mocking Blocking network requests intercept("https://www.google-analytics.com/analytics.js") Redirection intercept("https://fetchdata.com", "http://fetchtestdata.com") Stubbing intercept("https://fetchdata.com", {"test": data }) Request modification intercept("https://fetchdata.com", (request) => {request.continue({"custom": "data"})})) Slide 19
  • 20. Other Interesting Stu Geolocation Mocking overridePermissions("https://test.com/geolocation",['geolocation']) setLocation({ latitude: 27.1752868, longitude: 78.040009, accuracy:20 }) Emulate network emulateNetwork("WiFi") Emulate device emulateDevice('iPhone 6') Set Cookies setCookie("CSRFToken","csrfToken", {url: "http://test.com"}) Slide 20
  • 21. The "Hello World" of Taiko openBrowser() goto("google.com") write("taiko test automation") click("Google Search") Getting the recorded code .code const { openBrowser, goto, write, click } = require('taiko'); (async () => { try { await openBrowser(); await goto("google.com"); await write("taiko test automation"); await click("Google Search"); } catch (e) { console.error(e); } finally { closeBrowser(); } })(); Slide 21
  • 22. Installation with GaugeInstallation with Gauge Slide 22Slide 22
  • 23. Free and open source test automation framework by ThoughtWorks Recommended test runner for Taiko Slide 23
  • 24. Installing Gauge npm install @getgauge/cli Initializing a Taiko project gauge init js Create a Step Implementation .step("When I search for taiko", async () => { try { await openBrowser(); await goto("google.com"); await write("taiko test automation"); await click("Google Search"); } catch (e) { console.error(e); } finally { closeBrowser(); } }); Slide 24