SlideShare a Scribd company logo
A U T O M AT E D T E S T I N G
O F W E B A P P S
+Jonatan Kronqvist @zch
Automated Testing of Web Applications
Automated Testing of Web Applications
}>
Automated Testing of Web Applications
A G E N D A
• Software testing in general
• Architecting for testability
• Testing web UIs
• What should I do?
A G E N D A
• Software testing in general
• Architecting for testability
• Testing web UIs
• What should I do?
Automated Testing of Web Applications
Unit Testing
Integration Testing
System Testing
Regression Testing
End-to-End Testing
Acceptance Testing
Load Testing
Create VALUE for Your Customers
– J O H N D O E V E L O P E R
“Unit testing is a waste of time, because the tests
don't prove that things work correctly”
Automated Testing of Web Applications
Red
Green
Refactor
1. You will ALWAYS have code that worked a minute ago
2. You will have more and more automatic tests that can be
run all the time
3. You will have usage examples for all of your code and API
4. All your code will be testable by default
Best ROI:
• integration
• regression
• system
Most unit tests could be
replaced by assertions
Focus on continuous integration
and system testing
B E H AV I O R D R I V E N D E V E L O P M E N T
Scenario 1: Account has sufficient funds
Given the account balance is $100
And the card is valid
And the machine contains enough money
When the Account Holder requests $20
Then the ATM should dispense $20
And the account balance should be $80
And the card should be returned
1. Easy to define end-to-end behavior to be tested
2. Business value easily translates to this format
3. You're probably already defining user stories
A G E N D A
• Software testing in general
• Architecting for testability
• Testing web UIs
• What should I do?
Automated Testing of Web Applications
• Cross browser differences
• Logic that depends on the DOM
• Asynchronous execution
• Possibly slow execution
M V P
Presenter
Model
(State)
View
Rendering
logic
Event
handling
logic
Avoid new – Dependency Injection
A G E N D A
• Software testing in general
• Architecting for testability
• Testing web UIs
• What should I do?
Automated Testing of Web Applications
Unit Testing?
Integration Testing?
System Testing?
End-to-end Testing?
Web automation
BDD framework + Selenium or Vaadin
TestBench
Automated Testing of Web Applications
Narrative:

As a user

I want to perform calculations

So that I can easily get the results without
calculating in my head



Scenario: Calculate 1+2

Given I have the calculator open

When I push 1+2

Then the result should be 3.0
public class CalculatorSteps extends TestBenchTestCase {



private WebDriver driver;

private CalculatorPageObject calculator;



@BeforeScenario

public void setUpWebDriver() {

driver = TestBench.createDriver(new FirefoxDriver());

calculator = PageFactory.initElements(driver,
CalculatorPageObject.class);

}
@AfterScenario

public void tearDownWebDriver() {

driver.quit();

}
@Given("I have the calculator open")

public void theCalculatorIsOpen() {

calculator.open();

}



@When("I push $buttons")

public void enter(String buttons) {

calculator.enter(buttons);

}



@Then("the result should be $result")

public void assertResult(String result) {

assertEquals(result, calculator.getResult());

}

}
public class SimpleCalculation extends JUnitStory {

@Override

public Configuration configuration() {

return new MostUsefulConfiguration()

.useStoryLoader(new LoadFromClasspath(this.getClass()))

.useStoryReporterBuilder(new StoryReporterBuilder()
.withDefaultFormats()
.withFormats(Format.CONSOLE, Format.TXT));

}



@Override

public InjectableStepsFactory stepsFactory() {

return new InstanceStepsFactory(configuration(),
new CalculatorSteps());

}

}
Automated Testing of Web Applications
}>
>2500 tests
<15 minutes
each commit
Load Testing
A G E N D A
• Software testing in general
• Architecting for testability
• Testing web UIs
• What should I do?
WHAT SHOULD I DO?
Architect for testability and flexibility
Focus on Integration, End-to-end and System
Tests
Try TDD, but don't sweat it
Use BDD
Don't forget to load test!
ENSURE VALUE IS CREATED
FOR YOUR CUSTOMERS
Q & A
Please rate the presentation at
gwtcreate.com/agenda
I M A G E S U S E D
• https://flic.kr/p/671Z4A
• https://flic.kr/p/bsozXc
• https://flic.kr/p/hRfBC
• https://flic.kr/p/nQ7ac5
• https://flic.kr/p/8sf5Xt
• https://flic.kr/p/4LH5Eo
• https://flic.kr/p/7Lx9Kk
• https://flic.kr/p/nAi4GZ
• https://flic.kr/p/eguHX8
• https://flic.kr/p/4fmu9E
• https://flic.kr/p/dtSHid
• https://flic.kr/p/bwpVQ7
• https://flic.kr/p/fGyo6Q

More Related Content

PPTX
ASP.NET & Unit Testing
PDF
Fast end-to-end-tests
PDF
Automated Performance Testing
PDF
Becoming a better programmer - unit testing
PDF
PDF
Extreme Programming - to the next-level
PPTX
Dot all 2019 | Testing with Craft | Giel Tettelar
PDF
Introduction to Automated Testing
ASP.NET & Unit Testing
Fast end-to-end-tests
Automated Performance Testing
Becoming a better programmer - unit testing
Extreme Programming - to the next-level
Dot all 2019 | Testing with Craft | Giel Tettelar
Introduction to Automated Testing

What's hot (20)

PPTX
Visual Studio 2010 Testing for Developers
PPTX
Manual, Visual, and Automated Testing For Web Apps
PPTX
Writing better tests for your java script app
PPTX
Getting Started With Selenium
PDF
Usg Web Tech Day 2016 - Continuous Integration, Deployment, and Delivery
PPTX
Test Design + Environment Management: Scaling UI Automation for Agile
PDF
Continuous Integration
PDF
QA Strategies for Testing Legacy Web Apps
PDF
Using Crowdsourced Testing to Turbocharge your Development Team
PPTX
Sustainable Automation Frameworks by Kelsey Shannahan
PDF
Test Driven Development
PDF
Agile Testing
PPTX
How to write better tests with Test Driven Development
PDF
Perl testing 101
PDF
Keynote AST 2016
PPTX
Test Automation Architecture That Works by Bhupesh Dahal
PPTX
5 Considerations When Adopting Automated Testing
PPTX
QA Automation testing online training
PPTX
ATAGTR2017 The way to recover the issue faced in IoT regression Testing
PPTX
Software engineering
Visual Studio 2010 Testing for Developers
Manual, Visual, and Automated Testing For Web Apps
Writing better tests for your java script app
Getting Started With Selenium
Usg Web Tech Day 2016 - Continuous Integration, Deployment, and Delivery
Test Design + Environment Management: Scaling UI Automation for Agile
Continuous Integration
QA Strategies for Testing Legacy Web Apps
Using Crowdsourced Testing to Turbocharge your Development Team
Sustainable Automation Frameworks by Kelsey Shannahan
Test Driven Development
Agile Testing
How to write better tests with Test Driven Development
Perl testing 101
Keynote AST 2016
Test Automation Architecture That Works by Bhupesh Dahal
5 Considerations When Adopting Automated Testing
QA Automation testing online training
ATAGTR2017 The way to recover the issue faced in IoT regression Testing
Software engineering
Ad

Viewers also liked (19)

PDF
Accelerated learning pathways print
PDF
R For Rabbit - All Product Broucher
DOCX
Marissa Menendez Major Project Paper 1-30-15
PPTX
Fighting affluenza epidemic in america
PPTX
«Актуальність Батишевських ідей, щодо комп’ютеризації навчання»
PDF
NYAPE-5 Steps to Create Sustainable Change
PDF
Los procesos de colaboración público/privada en sanidad en Europa: ¿una moda ...
PPTX
Inking a Harmonious Career: Technical Writers who want to to enter, survive, ...
PPTX
Aboriginal Law Update, May 2015
PDF
UK brands proximity marketing survey
PPTX
Fighting affluenza epidemic in america
PDF
Mem consultora habilitada-eia_dgaam
PDF
Lake tana finance initiative
PDF
A&GS Newsletter2007Final
PDF
"Эволюция бизнес-модели Prom.ua" Николай Жандоров (Prom.ua)
PDF
Internet como soporte a una nueva generación de disease management
ODP
Fast&food restaurant.finishodp
PDF
El seguro de salud de empresa
PDF
Un nuevo salto para el sector sanitario: del diseño de procesos al BPM (Busin...
Accelerated learning pathways print
R For Rabbit - All Product Broucher
Marissa Menendez Major Project Paper 1-30-15
Fighting affluenza epidemic in america
«Актуальність Батишевських ідей, щодо комп’ютеризації навчання»
NYAPE-5 Steps to Create Sustainable Change
Los procesos de colaboración público/privada en sanidad en Europa: ¿una moda ...
Inking a Harmonious Career: Technical Writers who want to to enter, survive, ...
Aboriginal Law Update, May 2015
UK brands proximity marketing survey
Fighting affluenza epidemic in america
Mem consultora habilitada-eia_dgaam
Lake tana finance initiative
A&GS Newsletter2007Final
"Эволюция бизнес-модели Prom.ua" Николай Жандоров (Prom.ua)
Internet como soporte a una nueva generación de disease management
Fast&food restaurant.finishodp
El seguro de salud de empresa
Un nuevo salto para el sector sanitario: del diseño de procesos al BPM (Busin...
Ad

Similar to Automated Testing of Web Applications (20)

PPT
Automation Testing on Selenium by Quontra Solutions
PDF
Building a Complete Pipeline: The Essential Components of Continuous Testing ...
PDF
Lecture #6. automation testing (andrey oleynik)
PDF
Continuous Integration
PPTX
Udvid din test portefølje med coded ui test og cloud load test
PDF
Automated Testing in DevOps
PPTX
How to Embed Codeless Test Automation Into DevOps
PDF
Continuous delivery @wcap 5-09-2013
PPTX
QAorHighway2016
PPTX
Slides for Automation Testing or End to End testing
PPTX
Continuous integration, delivery & deployment
PPTX
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
PPTX
Dev ops presentation
PPTX
Test automation proposal
PPTX
How do you tame a big ball of mud? One test at a time.
PPT
Test Driven Development and Automation
PPTX
Testing of React JS app
PDF
End-end tests as first class citizens - SeleniumConf 2020
PPTX
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
PPTX
ASP.NET 5 & Unit Testing
Automation Testing on Selenium by Quontra Solutions
Building a Complete Pipeline: The Essential Components of Continuous Testing ...
Lecture #6. automation testing (andrey oleynik)
Continuous Integration
Udvid din test portefølje med coded ui test og cloud load test
Automated Testing in DevOps
How to Embed Codeless Test Automation Into DevOps
Continuous delivery @wcap 5-09-2013
QAorHighway2016
Slides for Automation Testing or End to End testing
Continuous integration, delivery & deployment
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
Dev ops presentation
Test automation proposal
How do you tame a big ball of mud? One test at a time.
Test Driven Development and Automation
Testing of React JS app
End-end tests as first class citizens - SeleniumConf 2020
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
ASP.NET 5 & Unit Testing

Recently uploaded (20)

PPTX
history of c programming in notes for students .pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Transform Your Business with a Software ERP System
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
L1 - Introduction to python Backend.pptx
PPTX
ai tools demonstartion for schools and inter college
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Nekopoi APK 2025 free lastest update
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Introduction to Artificial Intelligence
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Design an Analysis of Algorithms I-SECS-1021-03
history of c programming in notes for students .pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
Odoo Companies in India – Driving Business Transformation.pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Transform Your Business with a Software ERP System
Computer Software and OS of computer science of grade 11.pptx
L1 - Introduction to python Backend.pptx
ai tools demonstartion for schools and inter college
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Operating system designcfffgfgggggggvggggggggg
Softaken Excel to vCard Converter Software.pdf
Nekopoi APK 2025 free lastest update
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Introduction to Artificial Intelligence
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PTS Company Brochure 2025 (1).pdf.......
Design an Analysis of Algorithms I-SECS-1021-03

Automated Testing of Web Applications

  • 1. A U T O M AT E D T E S T I N G O F W E B A P P S +Jonatan Kronqvist @zch
  • 4. }>
  • 6. A G E N D A • Software testing in general • Architecting for testability • Testing web UIs • What should I do?
  • 7. A G E N D A • Software testing in general • Architecting for testability • Testing web UIs • What should I do?
  • 16. Create VALUE for Your Customers
  • 17. – J O H N D O E V E L O P E R “Unit testing is a waste of time, because the tests don't prove that things work correctly”
  • 20. 1. You will ALWAYS have code that worked a minute ago 2. You will have more and more automatic tests that can be run all the time 3. You will have usage examples for all of your code and API 4. All your code will be testable by default
  • 21. Best ROI: • integration • regression • system
  • 22. Most unit tests could be replaced by assertions
  • 23. Focus on continuous integration and system testing
  • 24. B E H AV I O R D R I V E N D E V E L O P M E N T
  • 25. Scenario 1: Account has sufficient funds Given the account balance is $100 And the card is valid And the machine contains enough money When the Account Holder requests $20 Then the ATM should dispense $20 And the account balance should be $80 And the card should be returned
  • 26. 1. Easy to define end-to-end behavior to be tested 2. Business value easily translates to this format 3. You're probably already defining user stories
  • 27. A G E N D A • Software testing in general • Architecting for testability • Testing web UIs • What should I do?
  • 29. • Cross browser differences • Logic that depends on the DOM • Asynchronous execution • Possibly slow execution
  • 31. Avoid new – Dependency Injection
  • 32. A G E N D A • Software testing in general • Architecting for testability • Testing web UIs • What should I do?
  • 39. BDD framework + Selenium or Vaadin TestBench
  • 41. Narrative:
 As a user
 I want to perform calculations
 So that I can easily get the results without calculating in my head
 
 Scenario: Calculate 1+2
 Given I have the calculator open
 When I push 1+2
 Then the result should be 3.0
  • 42. public class CalculatorSteps extends TestBenchTestCase {
 
 private WebDriver driver;
 private CalculatorPageObject calculator;
 
 @BeforeScenario
 public void setUpWebDriver() {
 driver = TestBench.createDriver(new FirefoxDriver());
 calculator = PageFactory.initElements(driver, CalculatorPageObject.class);
 } @AfterScenario
 public void tearDownWebDriver() {
 driver.quit();
 }
  • 43. @Given("I have the calculator open")
 public void theCalculatorIsOpen() {
 calculator.open();
 }
 
 @When("I push $buttons")
 public void enter(String buttons) {
 calculator.enter(buttons);
 }
 
 @Then("the result should be $result")
 public void assertResult(String result) {
 assertEquals(result, calculator.getResult());
 }
 }
  • 44. public class SimpleCalculation extends JUnitStory {
 @Override
 public Configuration configuration() {
 return new MostUsefulConfiguration()
 .useStoryLoader(new LoadFromClasspath(this.getClass()))
 .useStoryReporterBuilder(new StoryReporterBuilder() .withDefaultFormats() .withFormats(Format.CONSOLE, Format.TXT));
 }
 
 @Override
 public InjectableStepsFactory stepsFactory() {
 return new InstanceStepsFactory(configuration(), new CalculatorSteps());
 }
 }
  • 48. A G E N D A • Software testing in general • Architecting for testability • Testing web UIs • What should I do?
  • 50. Architect for testability and flexibility
  • 51. Focus on Integration, End-to-end and System Tests
  • 52. Try TDD, but don't sweat it
  • 54. Don't forget to load test!
  • 55. ENSURE VALUE IS CREATED FOR YOUR CUSTOMERS
  • 56. Q & A Please rate the presentation at gwtcreate.com/agenda
  • 57. I M A G E S U S E D • https://flic.kr/p/671Z4A • https://flic.kr/p/bsozXc • https://flic.kr/p/hRfBC • https://flic.kr/p/nQ7ac5 • https://flic.kr/p/8sf5Xt • https://flic.kr/p/4LH5Eo • https://flic.kr/p/7Lx9Kk • https://flic.kr/p/nAi4GZ • https://flic.kr/p/eguHX8 • https://flic.kr/p/4fmu9E • https://flic.kr/p/dtSHid • https://flic.kr/p/bwpVQ7 • https://flic.kr/p/fGyo6Q