Features
< Back to Blog Overview

Frontend Performance Testing

2019-02-27
Frontend Performance Testing
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn
  • Share on HackerNews
Chrome Devtools

With the release of TestingBot's Performance Testing, you can now retrieve various performance metrics from Chrome during your Automated Tests.


We fetch these various metrics from the Chrome browser via Chrome's Devtools Protocol.


TestingBot has added custom WebDriver commands which you can use to fetch metrics from the Chrome browser during your test, including:

  • Pageload Time
  • Number of HTTP(s) requests
  • domContentLoaded
  • firstPaint metrics

With this new feature, you can for example add checks in your Automated tests to verify if the Pageload Time is below a specific threshold.
If the Pageload Time is too high, the test will fail, alerting you that a performance regression occurred.


Please see our Frontend Performance Testing Documentation for more details on how to use this feature.


Sample Code:


require "rubygems"
require "selenium-webdriver"
require "selenium/client"

caps = {
  :browserName => "chrome",
  :version => "latest",
  :platform => "WIN10",
  :debugging => true
}

urlhub = "https://API_KEY:API_SECRET@hub.testingbot.com/wd/hub"
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 120

@webdriver = Selenium::WebDriver.for :remote, :url => urlhub, :desired_capabilities => caps, :http_client => client

@webdriver.navigate.to "https://testingbot.com/"
performance = @webdriver.execute_script("tb:performance")
assert performance["load"] < 900 # if the pageload time is below 0.9 seconds, fail the test.
@webdriver.quit
TestingBot Logo

Sign up for a Free Trial

Start testing your apps with TestingBot.

No credit card required.

Other Articles

TestingBot and ScriptWorks integration: Codeless Automated Testing

ScriptWorks offers an online service making it easy to create automated tests without any coding knowledge.

Read more
The New Selenium IDE

The popular Selenium IDE recently got a much anticipated update. The Selenium IDE is an important feature in the Selenium ecosystem; it all...

Read more
Black Friday and Cyber Monday Testing

Black Friday and Cyber Monday is the time of the year for many businesses, including e-commerce websites. During this period, the number of v...

Read more