SlideShare una empresa de Scribd logo
1 de 44
©ThoughtWorks 2019
“Software testing is a process, or a series of
processes, designed to make sure computer code
does what it was designed to do and that it does
not do anything unintended.”
- Glenford J Myers
©ThoughtWorks 2019
taiko.gauge.org ©ThoughtWorks 2019
“Are you ready to challenge your existing beliefs
about test automation?”
©ThoughtWorks 2019
taiko.gauge.org
End to end browser tests
Problems associated with UI tests:
● Cost of maintenance is high
● Long time to run. (around 4-12 hours)
● Considered Flaky
● Long feedback cycles
©ThoughtWorks 2019
UI Tests
Service Tests
Unit Tests
Unit tests are
important but they
aren’t tests, they
are a part of the
development
process!
©ThoughtWorks 2019
taiko.gauge.org
Research
©ThoughtWorks 2019
taiko.gauge.org
Our findings!
Maintenance Test flakiness Learning curve
©ThoughtWorks 2019
TODO App
System under test
©ThoughtWorks 2019
©ThoughtWorks 2019
©ThoughtWorks 2019
©ThoughtWorks 2019
©ThoughtWorks 2019
taiko.gauge.org
Lets run some tests
with Selenium
To Understand the problems with Maintenance
©ThoughtWorks 2019
taiko.gauge.org ©ThoughtWorks 2019
taiko.gauge.org
{
await driver.get('http://todomvc.com/examples/angularjs/#/');
...
var newElements = await
driver.findElements(By.xpath('//ul[@class="todo-list"]/li[@class=""]'));
assert.ok(newElements.length == 1);
...
}
What went wrong? Did the Functionality change?
Error:
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
assert.ok(newElements.length==1)
Did the DOM change?Test can’t find the required css
©ThoughtWorks 2019
taiko.gauge.org
Pros and Cons
of using Xpath or Css
style selectors in tests
We have always been
doing that isn’t it?
©ThoughtWorks 2019
“Maintaining locators must be calculated as part of
test maintenance cost.”
Zac Campbell (Mozilla Test Engineering Blog)
https://blog.mozilla.org/fxtesteng/2013/09/26/writing-reliable-locators-for-selenium-and-webdriver-tests/
But then, what about Modern Web frameworks?
©ThoughtWorks 2019
taiko.gauge.org
Lets Understand how
flakiness affects your Tests!
©ThoughtWorks 2019
taiko.gauge.org ©ThoughtWorks 2019
taiko.gauge.org
What went wrong?
()=> {
...
await driver.get('http://todomvc.com/examples/react/#/');
await driver.sleep(300);
await driver.findElement(By.css('input[placeholder="What needs to be done?"))
.sendKeys('Automate web page');
...
}
Error:
NoSuchElementError: no such element: Unable to locate element: {"method":"css
selector","selector":"input[placeholder="What needs to be done?"]"}
Test can’t find the elementExplicit Wait... in test code
©ThoughtWorks 2019
taiko.gauge.org
Does this solve the issue?
()=> {
...
await driver.sleep(300);
await driver.wait(until.elementLocated(
By.css('input[placeholder="What needs to be done?"]')));
await driver.wait(until.elementIsVisible(driver.findElement(
By.css('input[placeholder="What needs to be done?"]'))));
await driver.findElement(By.css('input[placeholder="What needs to be done?"))
.sendKeys('Automate web page');
...
}
©ThoughtWorks 2019
“Almost 16% of the our tests have some flakiness
associated with them! This is a staggering number; it
means that more than 1 in 7 of the tests written by our
world-class engineers occasionally fail in a way not
caused by changes to the code or tests”
- John Micco (Google Testing Blog https://testing.googleblog.com/2016/05/flaky-
tests-at-google-and-how-we.html?m=1)
©ThoughtWorks 2019
taiko.gauge.org
 Page Object Pattern
 Advanced Page Object Pattern
 Facade Design Pattern
 Singleton Design Pattern
 Fluent Page Object Pattern
 IoC Container and Page Object
 Strategy Design Pattern
 Advanced Strategy Design Pattern
 Observer Design Pattern
 Observer Design Pattern via Events and Delegate
 Observer Design Pattern via IObservable and IObserver
Learning curves
©ThoughtWorks 2019
“Testers spend 50% of their time designing and
maintaining test frameworks”
©ThoughtWorks 2019
taiko.gauge.org
Understanding
the problem!
Auto generated code using recorders
©ThoughtWorks 2019
It’s time we stopped
looking for workarounds!
Our take on these pain points
©ThoughtWorks 2019
taiko.gauge.org
The different approach!
Low learning curve
Eases the complex of the required test code
Allows to automate modern Web applications quickly and
Reduces test flakiness with
Nifty APIs
What is needed is a tool which has
©ThoughtWorks 2019
taiko.gauge.org
Introducing Taiko!
©ThoughtWorks 2019
taiko.gauge.org
Smart Selectors
async()=> {
...
await click("Active");
...
}
©ThoughtWorks 2019
taiko.gauge.org
Smart Selectors
async()=> {
...
await write("Tech Radar")));
...
}
©ThoughtWorks 2019
taiko.gauge.org
Proximity Selectors
async()=> {
...
await click(checkBox(near("Tech Radar")));
...
}
©ThoughtWorks 2019
taiko.gauge.org
Ease of use
Taiko REPL
©ThoughtWorks 2019
taiko.gauge.org ©ThoughtWorks 2019
taiko.gauge.org
Lets try to automate the same
tests with Taiko!
©ThoughtWorks 2019
taiko.gauge.org ©ThoughtWorks 2019
taiko.gauge.org
Implicit waits
async()=> {
await openBrowser({headless:false});
await goto('http://todomvc.com/examples/react/#/');
await write('Tech Radar',into(textBox({placeholder:"What needs to be done?"})));
...
await closeBrowser();
}
©ThoughtWorks 2019
taiko.gauge.org
Putting all together
async()=> {
await openBrowser({headless:false});
await goto('http://todomvc.com/examples/react/#/');
await write('Automate web page', into(inputField({ placeholder: "What
needs to be done?" })));
await press('Enter');
assert.ok(await text('1 item left').exists());
await click(checkBox(near('Automate web page')));
assert.ok(await text('0 items left').exists());
await closeBrowser();
}
With smart selectors and implicit waits
©ThoughtWorks 2019
taiko.gauge.org
Other Features of Taiko
 Network Interceptors are built in
eg:
intercept("https://fetchdata.com", {"test": data })
Mocking and stubbing
 Extensible using Plugins
 Taiko Diagnostics plugin
 Taiko Screencast plugin
 Taiko Android plugin
©ThoughtWorks 2019
taiko.gauge.org
Integration with Test Frameworks
+
©ThoughtWorks 2019
taiko.gauge.org
Comparison Summary
©ThoughtWorks 2019
taiko.gauge.org
Summary
The different approach!
At ThoughtWorks testing
plays a big role while
delivering projects. We keep
learning from our projects
to improve and create
better tools. We write a lot
about it, create a lot of
open source testing tools to
make testing easier.
 Automate tests quickly
 Reduce associated maintenance cost by using smart
selectors
 Keep test code clean and reduce flakiness by letting
taiko handle waits for you
 A NodeJS library offers all you need to write End-end
tests. Explore more and let us know your feedback!
©ThoughtWorks 2019
taiko.gauge.org
 Maintaining locators must be calculated as part of the cost of test maintenance. -
https://blog.mozilla.org/fxtesteng/2013/09/26/writing-reliable-locators-for-selenium-
and-webdriver-tests/
 Almost 16% of our tests have some level of flakiness associated with them! -
https://testing.googleblog.com/2016/05/flaky-tests-at-google-and-how-we.html?m=1
 A whooping 44% automation checks are done using Java -
https://applitools.com/blog/language-software-test-automation
 Unit tests aren’t tests - https://gauge.org/2019/03/15/unit-tests-arent-tests/
 Try Gauge and Taiko - https://gauge.org/gauge-taiko
 Gauge and Taiko Blogs - https://gauge.org/blog/
 Gauge and Taiko Gitter Channel - https://gitter.im/getgauge/chat
 Gauge and Taiko Google group - getgauge@googlegroups.com
References
©ThoughtWorks 2019
THANK YOU!
#TWISummit
Please share your
feedback with
nehashrl@thoughtworks.com
sswaroop@thoughtworks.com
©ThoughtWorks 2019

Más contenido relacionado

Similar a TWISummit 2019 - Take the Pain out of Browser Automation!

20160913 cookpad ios_en
20160913 cookpad ios_en20160913 cookpad ios_en
20160913 cookpad ios_enKazuaki Matsuo
 
An Introduction to Web Components
An Introduction to Web ComponentsAn Introduction to Web Components
An Introduction to Web ComponentsRed Pill Now
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyondmguillem
 
The Safety Net of Functional Web Testing
The Safety Net of Functional Web TestingThe Safety Net of Functional Web Testing
The Safety Net of Functional Web Testingogborstad
 
Susan windsor soft test 16th november 2005
Susan windsor soft test   16th november 2005Susan windsor soft test   16th november 2005
Susan windsor soft test 16th november 2005David O'Dowd
 
How to easily design and automate test cases.pdf
How to easily design and automate test cases.pdfHow to easily design and automate test cases.pdf
How to easily design and automate test cases.pdfMaveryx
 
Good practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsGood practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsAbhijeet Vaikar
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETBen Hall
 
Testing of React JS app
Testing of React JS appTesting of React JS app
Testing of React JS appAleks Zinevych
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testingdrewz lin
 
Automation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and BeyondAutomation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and BeyondTechWell
 
Puppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing ToolPuppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing ToolMiki Lombardi
 
How to kill test flake in appium
How to kill test flake in appiumHow to kill test flake in appium
How to kill test flake in appiumGaurav Singh
 
Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Ortus Solutions, Corp
 
How to React to JavaScript Insecurity
How to React to JavaScript InsecurityHow to React to JavaScript Insecurity
How to React to JavaScript InsecurityKsenia Peguero
 
Fostering Long-Term Test Automation Success
Fostering Long-Term Test Automation SuccessFostering Long-Term Test Automation Success
Fostering Long-Term Test Automation SuccessJosiah Renaudin
 
Getting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with ThymeleafGetting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with ThymeleafMasatoshi Tada
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersJavan Rasokat
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務Mu Chun Wang
 

Similar a TWISummit 2019 - Take the Pain out of Browser Automation! (20)

20160913 cookpad ios_en
20160913 cookpad ios_en20160913 cookpad ios_en
20160913 cookpad ios_en
 
An Introduction to Web Components
An Introduction to Web ComponentsAn Introduction to Web Components
An Introduction to Web Components
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
 
The Safety Net of Functional Web Testing
The Safety Net of Functional Web TestingThe Safety Net of Functional Web Testing
The Safety Net of Functional Web Testing
 
Susan windsor soft test 16th november 2005
Susan windsor soft test   16th november 2005Susan windsor soft test   16th november 2005
Susan windsor soft test 16th november 2005
 
How to easily design and automate test cases.pdf
How to easily design and automate test cases.pdfHow to easily design and automate test cases.pdf
How to easily design and automate test cases.pdf
 
Good practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium testsGood practices for debugging Selenium and Appium tests
Good practices for debugging Selenium and Appium tests
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NET
 
Testing of React JS app
Testing of React JS appTesting of React JS app
Testing of React JS app
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testing
 
Automation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and BeyondAutomation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and Beyond
 
Puppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing ToolPuppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing Tool
 
How to kill test flake in appium
How to kill test flake in appiumHow to kill test flake in appium
How to kill test flake in appium
 
Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018
 
How to React to JavaScript Insecurity
How to React to JavaScript InsecurityHow to React to JavaScript Insecurity
How to React to JavaScript Insecurity
 
Fostering Long-Term Test Automation Success
Fostering Long-Term Test Automation SuccessFostering Long-Term Test Automation Success
Fostering Long-Term Test Automation Success
 
Getting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with ThymeleafGetting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with Thymeleaf
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
 

Más de Thoughtworks

Design System as a Product
Design System as a ProductDesign System as a Product
Design System as a ProductThoughtworks
 
Designers, Developers & Dogs
Designers, Developers & DogsDesigners, Developers & Dogs
Designers, Developers & DogsThoughtworks
 
Cloud-first for fast innovation
Cloud-first for fast innovationCloud-first for fast innovation
Cloud-first for fast innovationThoughtworks
 
More impact with flexible teams
More impact with flexible teamsMore impact with flexible teams
More impact with flexible teamsThoughtworks
 
Culture of Innovation
Culture of InnovationCulture of Innovation
Culture of InnovationThoughtworks
 
Developer Experience
Developer ExperienceDeveloper Experience
Developer ExperienceThoughtworks
 
When we design together
When we design togetherWhen we design together
When we design togetherThoughtworks
 
Hardware is hard(er)
Hardware is hard(er)Hardware is hard(er)
Hardware is hard(er)Thoughtworks
 
Customer-centric innovation enabled by cloud
 Customer-centric innovation enabled by cloud Customer-centric innovation enabled by cloud
Customer-centric innovation enabled by cloudThoughtworks
 
Amazon's Culture of Innovation
Amazon's Culture of InnovationAmazon's Culture of Innovation
Amazon's Culture of InnovationThoughtworks
 
When in doubt, go live
When in doubt, go liveWhen in doubt, go live
When in doubt, go liveThoughtworks
 
Don't cross the Rubicon
Don't cross the RubiconDon't cross the Rubicon
Don't cross the RubiconThoughtworks
 
Your test coverage is a lie!
Your test coverage is a lie!Your test coverage is a lie!
Your test coverage is a lie!Thoughtworks
 
Docker container security
Docker container securityDocker container security
Docker container securityThoughtworks
 
Redefining the unit
Redefining the unitRedefining the unit
Redefining the unitThoughtworks
 
Technology Radar Webinar UK - Vol. 22
Technology Radar Webinar UK - Vol. 22Technology Radar Webinar UK - Vol. 22
Technology Radar Webinar UK - Vol. 22Thoughtworks
 
A Tribute to Turing
A Tribute to TuringA Tribute to Turing
A Tribute to TuringThoughtworks
 
Rsa maths worked out
Rsa maths worked outRsa maths worked out
Rsa maths worked outThoughtworks
 

Más de Thoughtworks (20)

Design System as a Product
Design System as a ProductDesign System as a Product
Design System as a Product
 
Designers, Developers & Dogs
Designers, Developers & DogsDesigners, Developers & Dogs
Designers, Developers & Dogs
 
Cloud-first for fast innovation
Cloud-first for fast innovationCloud-first for fast innovation
Cloud-first for fast innovation
 
More impact with flexible teams
More impact with flexible teamsMore impact with flexible teams
More impact with flexible teams
 
Culture of Innovation
Culture of InnovationCulture of Innovation
Culture of Innovation
 
Dual-Track Agile
Dual-Track AgileDual-Track Agile
Dual-Track Agile
 
Developer Experience
Developer ExperienceDeveloper Experience
Developer Experience
 
When we design together
When we design togetherWhen we design together
When we design together
 
Hardware is hard(er)
Hardware is hard(er)Hardware is hard(er)
Hardware is hard(er)
 
Customer-centric innovation enabled by cloud
 Customer-centric innovation enabled by cloud Customer-centric innovation enabled by cloud
Customer-centric innovation enabled by cloud
 
Amazon's Culture of Innovation
Amazon's Culture of InnovationAmazon's Culture of Innovation
Amazon's Culture of Innovation
 
When in doubt, go live
When in doubt, go liveWhen in doubt, go live
When in doubt, go live
 
Don't cross the Rubicon
Don't cross the RubiconDon't cross the Rubicon
Don't cross the Rubicon
 
Error handling
Error handlingError handling
Error handling
 
Your test coverage is a lie!
Your test coverage is a lie!Your test coverage is a lie!
Your test coverage is a lie!
 
Docker container security
Docker container securityDocker container security
Docker container security
 
Redefining the unit
Redefining the unitRedefining the unit
Redefining the unit
 
Technology Radar Webinar UK - Vol. 22
Technology Radar Webinar UK - Vol. 22Technology Radar Webinar UK - Vol. 22
Technology Radar Webinar UK - Vol. 22
 
A Tribute to Turing
A Tribute to TuringA Tribute to Turing
A Tribute to Turing
 
Rsa maths worked out
Rsa maths worked outRsa maths worked out
Rsa maths worked out
 

Último

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Último (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

TWISummit 2019 - Take the Pain out of Browser Automation!

Notas del editor

  1. [Soumya] So basically it’s a process or a series of processes to ensure code works as intended and NOT DO ANYTHING UNINTENDED
  2. [SOUMYA] At ThoughtWorks; testing, plays a very big role while delivering projects. Infact, we keep learning from our projects. It helps us improve and create better tools to make testing easier. ONE SUCH PRODUCT IS GAUGE. [Soumya] - I am the Lead QA on it [Neha] - and I am the Tech Lead on it Our goal is to provide Reliable Test Automation tools. Before we begin
  3. [Neha] ARE YOU READY TO CHALLENGE YOUR EXISTING BELIEFS ABOUT TEST AUTOMATION! We have seen that the Test Pyramid has been a common reference point for teams to structure their test suites
  4. [Neha] It is believed that there should be fewer UI tests and more of unit and service tests. Even the test pyramid clearly shows us that UI tests are costly and to have long running times. It’s become a common practice not invest in UI Tests and concentrate on Unit tests instead. This is because UI tests are often considered difficult to write and even more difficult to maintain.
  5. [NEHA] But, unit tests aren’t really tests! They are part of development process. After all, the developers are the ones who write these tests.
  6. [Neha] We have also faced a lot of problems while writing UI tests! We conducted a small survey. And here are our findings
  7. [Neha] The common pain points were Maintenance, Flakiness in tests and learning curve associated with the UI test tools
  8. [Soumya] Since we want to understand problems of test automation with examples. We will need a system under test, For that, we chose a simple TODO app! This is used to manage todo tasks. But today for the Demo we will only add a task and mark it as complete
  9. [Soumya] As you see, the App here is written in React JS.
  10. [Soumya] Here u can write the name of the task and press Enter to add it
  11. [Soumya] And then click on the checkbox to mark it as complete. Simple enough?
  12. [Soumya] The reason we chose this APP is because it is written in a bunch of UI frameworks with exactly the same functionality. For this demo, we will be using the React and AngularJS flavours of the APP.
  13. [Soumya] To understand the problems with Maintenance, lets automate todo App with Selenium. WHY SELENIUM: ‘Cause it's been around for ages and also been popular for a long time too. How many of you have used selenium before. Great! So, you will be able to relate to the examples we will be giving now!
  14. [SOUMYA] Let’s begin, this is the URL of our todo APP, the React flavour. Of Course SELENIUM selectors are dependent on the HTML structure When we run against the React flavour of our todo app. The tests pass. Obviously it was written specifically for it. I mean mainly the selectors. But now, lets see what happens when the same test is run against the AngularJS flavour of the application. The test failed.
  15. [SOUMYA] What went wrong? [CLICK] Why are the tests failing? Did the functionality change? No, [CLICK] Did the DOM change Yes [CLICK] And now! the test doesn’t seem to have the required CSS class.
  16. [SOUMYA] Let’s talk about some pros and cons of using selectors Xpath or Css selectors in tests. Yes, these are very powerful. They can select any element on your HTML page. But if you are going to use it in tests, we have to get used to updating them every time the HTML structure changes. Be it design change, streamlining of HTML or fix bugs. And this will be ongoing as long as your web app is evolving. [CLICK] We have been doing that isn’t it. We have got used to it also. So much so that
  17. [Soumya] We account for Maintaining locators in the test maintenance cost. As quoted in a Mozilla Test blog. [CLICK] But then, what about Modern Web frameworks? They auto-generate the HTML structure. It will perhaps take more effort to locate elements with Css or XPath selectors! [Next - Neha]
  18. [Neha] What else adds to your cost? Flakiness? Lets understand how flakiness affects your tests.
  19. [Neha] Here, the we have successfully run tests once. Does rerunning the test without any change give the same result? The tests have failed.
  20. [NEHA] What went wrong? Is the element to interact with available after a page load or asynchronous call without any waits? Perhaps Not [CLICK] Will introducing delays with magic numbers help? We saw otherwise [CLICK] Shall try using wait for conditions instead? [CLICK]
  21. [NEHA] Like so This looks complicated isn’t, what should be your focus be; testing the application or focus on the nitty gritties of the tool being used for automation!
  22. [Neha] Google Testing blogs claim that more than 1 in 7 of their tests occasionally fail in a way not caused by changes to the code or tests. Flaky tests are at least twice as harmful as we think. Why? Because - We not only waste time re-running flaky tests but also real test failures which we assume to flake out. This causes the team to lose their confidence in their test suite.
  23. [Soumya] After seeing maintenance and flakiness issues, you may think that learning curve is the least of your problems. But, having to write waits described earlier; or having to structure your test code with all the DOM selectors is overwhelming! You not only have to design your production code, but also your test code.
  24. [Soumya] Our observation with test projects has been that Tester’s spend close to 50% of the time designing and maintaining test frameworks. What if there were recorders to generate the required code! Then would we be spending less time and effort to maintain tests?.
  25. [NEHA] Not really! There are a lot tools which try to make writing tests easier by recording flow and generating the code. But, Be it auto generated code or handwritten, you see; the problems associated with DOM selectors doesn’t change. So, It’s but natural that there is a general complaint with code generated using such recorders are brittle and difficult to maintain. [Next Soumya]
  26. [Soumya] We have spoken so much about the problems. You know what this shows? It shows that over the period of time we have learned to live with the associated pain points and just been looking for work arounds for it. [CLICK] Sometimes all it takes is a different approach!
  27. [Soumya] What is needed today is a tool which has a low learning curve, Something that eases the complexity of the required test code Allows you to automate modern web applications quickly Takes care of reducing test flakiness With some nifty APIs
  28. [Neha] Yes, that’s where Taiko adds value! A tool that can be used to automate modern web applications easily. It is the tools aim to reduce the flakiness and help write more maintainable code! Let me give you a little insight about how Taiko was built. It is built over Chrome DevTools Protocol, the same Protocol used by the chrome console. So what does this mean for a team developing Taiko. It gives us a handle over the low level protocols used by the Chrome Browser. This means, better and direct control over the browser. So, how does this help you? Taiko is able to figure out low level details like when page loads are complete. So you don’t have to handle these in your tests anymore.
  29. [Soumya] In Taiko, the selectors are smart. It has simple APIs to automate what is visible on the screen. For example `click(“Active”)`. Clicks Active. The HTML tag associated with it doesn’t have to be specified
  30. [Soumya] If a textbox has focus, you can write into it using this simple API
  31. [Soumya] But; not all elements have text. What we can do in such cases is select elements based on their proximity to other elements. Here is an example where the checkbox near TechRadar is clicked. [Next - Neha]
  32. [Neha] As you have seen before, the selectors API’s are simple and can be used easily to give instructions for you to perform the action on the browser. You can continue to give instructions to complete the workflow. You can then create a script out of the successful actions performed. So you can think like a user to automate your workflow. It helps you in doing black box testing.
  33. [Neha] As you have seen before, the selectors API’s are simple and can be used easily to give instructions for the user to perform the action on the browser. The user can continue to give instructions to complete the workflow. The user can then create a script out of the successful actions performed. This along with our smart selectors, Taiko helps you think like a user to automate your workflow. It helps you in doing black box testing.
  34. [Soumya] Let’s take the same examples we used earlier and run the tests with Taiko. Let’s see what happens.
  35. [Soumya] First we run the test with the ReactJS flavor of the APP. As you can see, the smart selectors are not dependent on the HTML structure. Yes, the tests passed. But let’s re-run it. To check if this was a false positive. It seems to work fine even without explicit waits defined in test code. Now, let’s modify the application URL to point to the angularjs flavor of the app. Here the tests passed in both cases. In this case, with no changes in the workflow test code didn’t change. Mention fall back options - DOM selector [Next - Neha]
  36. [Neha] Taiko has reliable inbuilt wait mechanisms. This means, Starting from opening a browser to performing other tasks, in most cases there are no explicit waits needed.
  37. [Neha] Putting it all together, Taiko lets you focus on writing reliable tests and reduce the cost associated with test maintenance.
  38. [Neha] Taiko comes with a lot of other features. Like Network interceptors are built in. No more using a proxy server to stub that annoying 3rd party payment gateway service or the like. You can also record a video of your entire workflow using the Screencast plugin.
  39. [Neha] Since Taiko is a simple NodeJS library, you can integrate it with any test framework like Gauge or Mocha or Jest easily. However, you can find your testing experience simplified using Gauge and Taiko. TESTING EXPERIENCE SIMPLIFIED USING GAUGE + TAIKO
  40. [Soumya] There are a lot of free and open source tools to automate the browser and write end to end tests. Last year the Gauge team released Taiko. You may think it is yet another one in the market. But, in this blog, we will discuss what’s different about it. Here we compared Taiko with some popular browser testing tools. There will be always pros and cons with each tool you use. If you are looking for something with cross browser support, for instance, selenium would be a good fit. If you are looking to reliably automate modern web applications with low maintenance cost, it's worth considering Taiko.
  41. [Neha] ----- If you have some questions about Taiko you can always reach us out on Gitter for a quick chat, Google groups for discussion or the Stack overflow.
  42. Some references here