Features
< Back to Blog Overview

Mocking with WebDriver

2019-03-04
Advanced WebDriver Testing: Intercepting and Mocking Network
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn
  • Share on HackerNews

We've added various new/custom WebDriver commands to our Chrome Browsers.


  • Throttle the network speed
  • Fetch Network requests during your WebDriver tests
  • Intercept and mock network responses during your tests

Throttle Network Speed

With this new option, you can simulate different network speeds during your test.


Simulate a 4G connection, specify a GPRS speed or even test how your page reacts when there's no internet connection (offline mode).


You can change these settings during your test, so it makes it very easily to test real life situations. For example; people using their cell-phone suddenly experience a slower connection.


Fetch Network Requests

You can now fetch all network requests and responses during your test.
As WebDriver does not support reading status codes, it is now possible to use this command to fetch the status code, response headers and request headers.


Intercept and Mock

With this functionality, you can intercept and change responses during your test:

  • When a test visits a page, you can configure the browser to redirect to another page.
  • Configure specific URLs to immediately return an error during your test. Useful to disable ads/trackers during your tests
  • Change the entire response (body + headers) of any URL during your test.

Documentation for this new feature is available on our Debugging support page.

TestingBot Logo

Sign up for a Free Trial

Start testing your apps with TestingBot.

No credit card required.

Other Articles

Frontend Performance Testing

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

Read more
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 allows...

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 visi...

Read more
Testing with a Staging Environment - Continuous Deployment

In this article, we'd like to talk about how we at TestingBot make sure that new code that goes into production is tested thoroughly.

Read more
Automated and Live Testing in different Geographical Locations

We've added an option to our Live and Automated Testing platforms to specify from which country you'd like your test to run.

Read more