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

PDF
Automated Web App Performance Testing Using WebDriver
PPTX
Automated Testing with Google Chrome - WebDriver- ChromeDriver
PDF
Mobile WebDriver Selendroid
PPTX
Performance Metrics in a Day with Selenium
ODP
Synthetic web performance testing with Selenium
PDF
Client side production monitoring using - SyncApp Tool
PDF
Browserscope oscon 2011
PPT
Go With The Reflow
Automated Web App Performance Testing Using WebDriver
Automated Testing with Google Chrome - WebDriver- ChromeDriver
Mobile WebDriver Selendroid
Performance Metrics in a Day with Selenium
Synthetic web performance testing with Selenium
Client side production monitoring using - SyncApp Tool
Browserscope oscon 2011
Go With The Reflow

What's hot (20)

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

Similar to Web performance testing with web driver (20)

PPTX
Web Performance Testing
PPTX
Measuring web performance with user-centric metrics
PDF
Velocity building a performance lab for mobile apps in a day - final
PDF
Optimizing Websites for Great User Experiences and Increased Conversions
PDF
Client-Side Performance Testing
PDF
Client-Side Performance Testing
PDF
Client-side Performance Testing
PPTX
Webdriver with Thucydides - TdT@Cluj #18
PPTX
Qa process
PDF
Building a Robust WebDriverIO Test Automation Framework
PDF
Web driver selenium simplified
PDF
MeasureWorks - Outfox your Competition - Context is king, but Performance is ...
PPTX
webpagetest 1webpagetest 1webpagetest 1webpagetest 1webpagetest 1
PDF
Webapp Automation Testing of performance marketing and media platform
PPTX
The State of Performance in the WordPress Ecosystem
PDF
AtlasCamp 2013: Show Me Number! Automated Browser Performance Testing
PDF
Velocity 2013 london developer-friendly web performance testing in continuou...
PPTX
Browser Based Performance Testing and Tuning
PPTX
All levels of performance testing and monitoring in web-apps
PPTX
Qa process
Web Performance Testing
Measuring web performance with user-centric metrics
Velocity building a performance lab for mobile apps in a day - final
Optimizing Websites for Great User Experiences and Increased Conversions
Client-Side Performance Testing
Client-Side Performance Testing
Client-side Performance Testing
Webdriver with Thucydides - TdT@Cluj #18
Qa process
Building a Robust WebDriverIO Test Automation Framework
Web driver selenium simplified
MeasureWorks - Outfox your Competition - Context is king, but Performance is ...
webpagetest 1webpagetest 1webpagetest 1webpagetest 1webpagetest 1
Webapp Automation Testing of performance marketing and media platform
The State of Performance in the WordPress Ecosystem
AtlasCamp 2013: Show Me Number! Automated Browser Performance Testing
Velocity 2013 london developer-friendly web performance testing in continuou...
Browser Based Performance Testing and Tuning
All levels of performance testing and monitoring in web-apps
Qa process
Ad

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