---
title: 'Advanced WebDriver Testing: Intercepting and Mocking Network'
description: We've added various new/custom WebDriver commands to our Chrome Browsers.
source_url:
  html: https://testingbot.com/blog/webdriver-network-testing
  md: https://testingbot.com/blog/webdriver-network-testing.md
---

# Mocking with WebDriver

By [Jochen D.](https://testingbot.com/about/jochen-d)2019-03-04

 Share on Facebook 

 Share on Twitter 

 Post on Reddit 

 Share link 

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](https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/141), 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](https://testingbot.com/support/web-automate/selenium/network) page.

[← Previous post Frontend Performance Testing](https://testingbot.com/blog/frontend-performance-testing) [Next post → Launching Real Mobile Device Testing](https://testingbot.com/blog/real-mobile-device-testing)

## Sidebar

### TestingBot Cloud Testing

Run automated, manual and visual tests on remote browsers and devices. Sign up for a free trial.

[Free Trial](https://testingbot.com/users/sign_up)

### Latest articles

[![Announcing AI Test Insights](https://testingbot.com/assets/blog/2026/ai-insights.jpg)](https://testingbot.com/blog/ai-test-insights)

#### Announcing AI Test Insights

Use AI Insights to quickly discover why an automated test...

[Read: Announcing AI Test Insights](https://testingbot.com/blog/ai-test-insights)

[![Selenium vs Playwright 2026](https://testingbot.com/assets/blog/2026/selenium-vs-playwright-2026.jpg)](https://testingbot.com/blog/selenium-vs-playwright)

#### Selenium vs Playwright 2026

Comparing Selenium vs Playwright - which is the best test...

[Read: Selenium vs Playwright 2026](https://testingbot.com/blog/selenium-vs-playwright)

[![Maestro Physical Device Testing](https://testingbot.com/assets/blog/2026/maestro-physical.jpg)](https://testingbot.com/blog/maestro-physical-device-testing)

#### Maestro Physical Device Testing

Maestro testing in parallel on physical Android and iOS d...

[Read: Maestro Physical Device Testing](https://testingbot.com/blog/maestro-physical-device-testing)

## Related Articles

[![Selenium vs Playwright 2026](https://testingbot.com/assets/blog/2026/selenium-vs-playwright-2026.jpg)](https://testingbot.com/blog/selenium-vs-playwright "Selenium vs Playwright 2026")

### [Selenium vs Playwright 2026](https://testingbot.com/blog/selenium-vs-playwright)

Comparing Selenium vs Playwright - which is the best test framework for your usecase?

[Read article →](https://testingbot.com/blog/selenium-vs-playwright)

[![Selenium 20th birthday](https://testingbot.com/assets/blog/2024/selenium20.webp)](https://testingbot.com/blog/selenium-20-years "Selenium 20th birthday")

### [Selenium 20th birthday](https://testingbot.com/blog/selenium-20-years)

Celebrate Selenium's 20th birthday. An overview of the years.

[Read article →](https://testingbot.com/blog/selenium-20-years)

[![Selenium WebDriver BiDi](https://testingbot.com/assets/blog/2024/bidi.webp)](https://testingbot.com/blog/webdriver-bidi "Selenium WebDriver BiDi")

### [Selenium WebDriver BiDi](https://testingbot.com/blog/webdriver-bidi)

WebDriver BiDi support is now available on TestingBot. Learn how to use this exciting new improvement with your Selenium tests.

[Read article →](https://testingbot.com/blog/webdriver-bidi)

[![ChromeOS Cloud Testing](https://testingbot.com/assets/blog/2025/chromeos.jpg)](https://testingbot.com/blog/chromeos-testing "ChromeOS Cloud Testing")

### [ChromeOS Cloud Testing](https://testingbot.com/blog/chromeos-testing)

ChromeOS Manual and Automated testing in the cloud.

[Read article →](https://testingbot.com/blog/chromeos-testing)

## More by Jochen D.

[![Announcing AI Test Insights](https://testingbot.com/assets/blog/2026/ai-insights.jpg)](https://testingbot.com/blog/ai-test-insights "Announcing AI Test Insights")
### [Announcing AI Test Insights](https://testingbot.com/blog/ai-test-insights)

Use AI Insights to quickly discover why an automated test failed.

[![Maestro Physical Device Testing](https://testingbot.com/assets/blog/2026/maestro-physical.jpg)](https://testingbot.com/blog/maestro-physical-device-testing "Maestro Physical Device Testing")
### [Maestro Physical Device Testing](https://testingbot.com/blog/maestro-physical-device-testing)

Maestro testing in parallel on physical Android and iOS devices.

[![tvOS Physical Device Testing](https://testingbot.com/assets/blog/2025/appletv.jpg)](https://testingbot.com/blog/tvos-automated-testing "tvOS Physical Device Testing")
### [tvOS Physical Device Testing](https://testingbot.com/blog/tvos-automated-testing)

Run automated tvOS tests on physical AppleTV devices.

[See all posts by Jochen D. →](https://testingbot.com/about/jochen-d)

## Ready to start testing?
[Start a free trial](https://testingbot.com/users/sign_up)
