SlideShare a Scribd company logo
Web Performance Testing
with WebDriver
An integrated approach
Michael Klepikov
Make the Web Faster Team, Google
developers.google.com/speed
webpagetest.org
■ +1s load => -7% conversion rate
■ Just better user experience
■ Mobile exacerbates slowness
■ 46% mobile users abandon after 10s
Why is it important?
■ WebPageTest.org
■ Waterfall chart
■ Simulated latency
■ Many iterations for statistical validity
Page Load performance
Interactive scenarios
■ Multi-page
■ Login
■ Placing an order
■ AJAX is a better user experience
Test Systems Integration
■ WebPageTest is a separate system
■ Everyone has a custom toolchain
■ Hard to integrate
■ Not a seamless developer experience
■ Standard WD API:
○ Session Capabilities
○ Logging
■ Easy to enable in existing tests
■ Fits well into existing toolchains
Build it into WebDriver itself
■ LoggingPreferences
in WD capabilities
// Ask Chrome to collect "performance" log
DesiredCapabilities caps = DesiredCapabilities.chrome();
LoggingPreferences logPrefs = new LoggingPreferences();
logPrefs.enable("performance", Level.INFO);
caps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);
driver = new RemoteWebDriver("http://localhost:9515", caps);
WD API: Create Driver
■ Plain functional test, nothing special
■ Free magic for developers!
■ Pro tip: console.time()+timeEnd(), timeStamp()
driver.get("http://www.google.com/");
WebElement element = driver.findElement(By.name("q"));
element.sendKeys("GTAC 2013");
element.submit();
WD API: Run Test
■ Not part of test per se, inject:
○ In tearDown()
○ Override WebDriver.quit()
○ WebDriver HTTP-JSON proxy
log = driver.manage().logs().get("performance").getAll();
for (LogEntry entry : log) {
// WebDriver LogEntry message is a JSON string
JSONObject m = new JSONObject(entry.getMessage());
... m.getString("webview") ... // Originating WebView id
... m.getJSONObject("message") ... // Raw DevTools event
WD API: Get Performance Log
Performance Analysis
Demo
https://gist.github.com/klepikov/5457750
■ No WD within instrumented intervals
■ Aggregate over multiple iterations!
■ Run frontend in maximum isolation
○ Mock/stub/fake backends
■ Use WebPageReplay
Stable Repeatable Results

More Related Content

What's hot

W3C Web Performance - A detailed overview
W3C Web Performance - A detailed overviewW3C Web Performance - A detailed overview
W3C Web Performance - A detailed overview
Alois Reitbauer
 
Real World Progressive Web Apps (Building Flipkart Lite)
Real World Progressive Web Apps (Building Flipkart Lite)Real World Progressive Web Apps (Building Flipkart Lite)
Real World Progressive Web Apps (Building Flipkart Lite)
Abhinav Rastogi
 
Power Training DevDays 2009
Power Training DevDays 2009Power Training DevDays 2009
Power Training DevDays 2009
Master it Training
 
Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...
Thomas Audunhus
 
Measuring the visual experience of website performance
Measuring the visual experience of website performanceMeasuring the visual experience of website performance
Measuring the visual experience of website performance
Patrick Meenan
 
SQL Server - CLR integration
SQL Server - CLR integrationSQL Server - CLR integration
SQL Server - CLR integration
Peter Gfader
 
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Bill Condo
 
Test Automation Framework using Cucumber BDD Overview - part 2
Test Automation Framework using Cucumber BDD Overview - part 2Test Automation Framework using Cucumber BDD Overview - part 2
Test Automation Framework using Cucumber BDD Overview - part 2
Mindfire Solutions
 
Bluemix - Deploying a Java Web Application
Bluemix - Deploying a Java Web ApplicationBluemix - Deploying a Java Web Application
Bluemix - Deploying a Java Web Application
Craig Trim
 
Testing Single Page Webapp
Testing Single Page WebappTesting Single Page Webapp
Testing Single Page Webapp
Akshay Mathur
 
Meta Refresh 2014
Meta Refresh 2014Meta Refresh 2014
Meta Refresh 2014
Aakash Bapna
 
More efficient, usable web
More efficient, usable webMore efficient, usable web
More efficient, usable web
Chris Mills
 
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
Andreas Grabner
 
Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)
Ontico
 
From nothing to a video under 2 seconds / Mikhail Sychev (YouTube)
From nothing to a video under 2 seconds / Mikhail Sychev  (YouTube)From nothing to a video under 2 seconds / Mikhail Sychev  (YouTube)
From nothing to a video under 2 seconds / Mikhail Sychev (YouTube)
Ontico
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applications
Chris Love
 
"Spring Boot. Boot up your development" Сергей Моренец
"Spring Boot. Boot up your development" Сергей Моренец"Spring Boot. Boot up your development" Сергей Моренец
"Spring Boot. Boot up your development" Сергей Моренец
Fwdays
 
Modern Web Application Development Workflow - EclipseCon US 2014
Modern Web Application Development Workflow - EclipseCon US 2014Modern Web Application Development Workflow - EclipseCon US 2014
Modern Web Application Development Workflow - EclipseCon US 2014
Stéphane Bégaudeau
 
Windy cityrails performance_tuning
Windy cityrails performance_tuningWindy cityrails performance_tuning
Windy cityrails performance_tuning
John McCaffrey
 
Magento applications and modules functional testing
Magento applications and modules functional testingMagento applications and modules functional testing
Magento applications and modules functional testing
Neklo
 

What's hot (20)

W3C Web Performance - A detailed overview
W3C Web Performance - A detailed overviewW3C Web Performance - A detailed overview
W3C Web Performance - A detailed overview
 
Real World Progressive Web Apps (Building Flipkart Lite)
Real World Progressive Web Apps (Building Flipkart Lite)Real World Progressive Web Apps (Building Flipkart Lite)
Real World Progressive Web Apps (Building Flipkart Lite)
 
Power Training DevDays 2009
Power Training DevDays 2009Power Training DevDays 2009
Power Training DevDays 2009
 
Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...
 
Measuring the visual experience of website performance
Measuring the visual experience of website performanceMeasuring the visual experience of website performance
Measuring the visual experience of website performance
 
SQL Server - CLR integration
SQL Server - CLR integrationSQL Server - CLR integration
SQL Server - CLR integration
 
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
Performance Testing w/ WebPage Test Private Instance (DrupalCamp Ohio)
 
Test Automation Framework using Cucumber BDD Overview - part 2
Test Automation Framework using Cucumber BDD Overview - part 2Test Automation Framework using Cucumber BDD Overview - part 2
Test Automation Framework using Cucumber BDD Overview - part 2
 
Bluemix - Deploying a Java Web Application
Bluemix - Deploying a Java Web ApplicationBluemix - Deploying a Java Web Application
Bluemix - Deploying a Java Web Application
 
Testing Single Page Webapp
Testing Single Page WebappTesting Single Page Webapp
Testing Single Page Webapp
 
Meta Refresh 2014
Meta Refresh 2014Meta Refresh 2014
Meta Refresh 2014
 
More efficient, usable web
More efficient, usable webMore efficient, usable web
More efficient, usable web
 
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
 
Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)
 
From nothing to a video under 2 seconds / Mikhail Sychev (YouTube)
From nothing to a video under 2 seconds / Mikhail Sychev  (YouTube)From nothing to a video under 2 seconds / Mikhail Sychev  (YouTube)
From nothing to a video under 2 seconds / Mikhail Sychev (YouTube)
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applications
 
"Spring Boot. Boot up your development" Сергей Моренец
"Spring Boot. Boot up your development" Сергей Моренец"Spring Boot. Boot up your development" Сергей Моренец
"Spring Boot. Boot up your development" Сергей Моренец
 
Modern Web Application Development Workflow - EclipseCon US 2014
Modern Web Application Development Workflow - EclipseCon US 2014Modern Web Application Development Workflow - EclipseCon US 2014
Modern Web Application Development Workflow - EclipseCon US 2014
 
Windy cityrails performance_tuning
Windy cityrails performance_tuningWindy cityrails performance_tuning
Windy cityrails performance_tuning
 
Magento applications and modules functional testing
Magento applications and modules functional testingMagento applications and modules functional testing
Magento applications and modules functional testing
 

Similar to Web performance testing with web driver

Making the web faster
Making the web fasterMaking the web faster
Making the web faster
Patrick Meenan
 
TestMaker Object Designer Training - Basics
TestMaker Object Designer Training - BasicsTestMaker Object Designer Training - Basics
TestMaker Object Designer Training - Basics
Clever Moe
 
Web applications
Web applicationsWeb applications
Web applications
Peter Berezny
 
What Is New In TestMaker 6.5
What Is New In TestMaker 6.5What Is New In TestMaker 6.5
What Is New In TestMaker 6.5
Clever Moe
 
Espremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | ChaordicEspremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | Chaordic
Chaordic
 
Espremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | ChaordicEspremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | Chaordic
Carlos Tadeu Panato Junior
 
Service workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua PerformanceService workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua Performance
Piero Bellomo
 
Introduction to headless browsers
Introduction to headless browsersIntroduction to headless browsers
Introduction to headless browsers
Multidots Solutions Pvt Ltd
 
Selenium Online Training.pdf
Selenium Online Training.pdfSelenium Online Training.pdf
Selenium Online Training.pdf
SpiritsoftsTraining
 
Selenium Online Training.pdf
Selenium Online Training.pdfSelenium Online Training.pdf
Selenium Online Training.pdf
SpiritsoftsTraining
 
Selenium Online Training.pdf
Selenium Online Training.pdfSelenium Online Training.pdf
Selenium Online Training.pdf
SpiritsoftsTraining
 
Selenium Online Training.pdf
Selenium Online Training.pdfSelenium Online Training.pdf
Selenium Online Training.pdf
SpiritsoftsTraining
 
Dropwizard
DropwizardDropwizard
Dropwizard
Tetiana Saputo
 
Selenium Online Training.pdf
Selenium Online Training.pdfSelenium Online Training.pdf
Selenium Online Training.pdf
SpiritsoftsTraining
 
Dropwizard
DropwizardDropwizard
Dropwizard
Andrew Panfilov
 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance Testing
Grid Dynamics
 
Accessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup WebinarAccessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup Webinar
Keyur Shah
 
Measuring web performance
Measuring web performanceMeasuring web performance
Measuring web performance
Patrick Meenan
 
A Look into Automated Web UI Test
A Look into Automated Web UI TestA Look into Automated Web UI Test
A Look into Automated Web UI Test
Dhananjay Kumar
 
improving the performance of Rails web Applications
improving the performance of Rails web Applicationsimproving the performance of Rails web Applications
improving the performance of Rails web Applications
John McCaffrey
 

Similar to Web performance testing with web driver (20)

Making the web faster
Making the web fasterMaking the web faster
Making the web faster
 
TestMaker Object Designer Training - Basics
TestMaker Object Designer Training - BasicsTestMaker Object Designer Training - Basics
TestMaker Object Designer Training - Basics
 
Web applications
Web applicationsWeb applications
Web applications
 
What Is New In TestMaker 6.5
What Is New In TestMaker 6.5What Is New In TestMaker 6.5
What Is New In TestMaker 6.5
 
Espremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | ChaordicEspremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | Chaordic
 
Espremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | ChaordicEspremendo melancia | TDC2014 Floripa | Chaordic
Espremendo melancia | TDC2014 Floripa | Chaordic
 
Service workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua PerformanceService workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua Performance
 
Introduction to headless browsers
Introduction to headless browsersIntroduction to headless browsers
Introduction to headless browsers
 
Selenium Online Training.pdf
Selenium Online Training.pdfSelenium Online Training.pdf
Selenium Online Training.pdf
 
Selenium Online Training.pdf
Selenium Online Training.pdfSelenium Online Training.pdf
Selenium Online Training.pdf
 
Selenium Online Training.pdf
Selenium Online Training.pdfSelenium Online Training.pdf
Selenium Online Training.pdf
 
Selenium Online Training.pdf
Selenium Online Training.pdfSelenium Online Training.pdf
Selenium Online Training.pdf
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Selenium Online Training.pdf
Selenium Online Training.pdfSelenium Online Training.pdf
Selenium Online Training.pdf
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance Testing
 
Accessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup WebinarAccessibility Testing - Using Asqatasun - Meetup Webinar
Accessibility Testing - Using Asqatasun - Meetup Webinar
 
Measuring web performance
Measuring web performanceMeasuring web performance
Measuring web performance
 
A Look into Automated Web UI Test
A Look into Automated Web UI TestA Look into Automated Web UI Test
A Look into Automated Web UI Test
 
improving the performance of Rails web Applications
improving the performance of Rails web Applicationsimproving the performance of Rails web Applications
improving the performance of Rails web Applications
 

Web performance testing with web driver

  • 1. Web Performance Testing with WebDriver An integrated approach Michael Klepikov Make the Web Faster Team, Google developers.google.com/speed webpagetest.org
  • 2. ■ +1s load => -7% conversion rate ■ Just better user experience ■ Mobile exacerbates slowness ■ 46% mobile users abandon after 10s Why is it important?
  • 3. ■ WebPageTest.org ■ Waterfall chart ■ Simulated latency ■ Many iterations for statistical validity Page Load performance
  • 4. Interactive scenarios ■ Multi-page ■ Login ■ Placing an order ■ AJAX is a better user experience
  • 5. Test Systems Integration ■ WebPageTest is a separate system ■ Everyone has a custom toolchain ■ Hard to integrate ■ Not a seamless developer experience
  • 6. ■ Standard WD API: ○ Session Capabilities ○ Logging ■ Easy to enable in existing tests ■ Fits well into existing toolchains Build it into WebDriver itself
  • 7. ■ LoggingPreferences in WD capabilities // Ask Chrome to collect "performance" log DesiredCapabilities caps = DesiredCapabilities.chrome(); LoggingPreferences logPrefs = new LoggingPreferences(); logPrefs.enable("performance", Level.INFO); caps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs); driver = new RemoteWebDriver("http://localhost:9515", caps); WD API: Create Driver
  • 8. ■ Plain functional test, nothing special ■ Free magic for developers! ■ Pro tip: console.time()+timeEnd(), timeStamp() driver.get("http://www.google.com/"); WebElement element = driver.findElement(By.name("q")); element.sendKeys("GTAC 2013"); element.submit(); WD API: Run Test
  • 9. ■ Not part of test per se, inject: ○ In tearDown() ○ Override WebDriver.quit() ○ WebDriver HTTP-JSON proxy log = driver.manage().logs().get("performance").getAll(); for (LogEntry entry : log) { // WebDriver LogEntry message is a JSON string JSONObject m = new JSONObject(entry.getMessage()); ... m.getString("webview") ... // Originating WebView id ... m.getJSONObject("message") ... // Raw DevTools event WD API: Get Performance Log
  • 12. ■ No WD within instrumented intervals ■ Aggregate over multiple iterations! ■ Run frontend in maximum isolation ○ Mock/stub/fake backends ■ Use WebPageReplay Stable Repeatable Results