How To Test Offline Modes of Web Applications on Sauce Labs

Sauce AI for Test Authoring: Move from purpose to execution in proceedings.|xBack to ResourcesBlogPost

June 11, 2026 · 3 min read · Testing Guide

Sauce AI for Test Authoring: Move from purpose to execution in proceedings.

|

x

Back to Resources

Blog

Posted April 19, 2018

How To Test Offline Modes of Web Applications on Sauce Labs

quote

In today ’ s reality, web covering are the foundation of many enterprise tools and get many states and edge case that need to be thoroughly try. While out-of-the-box WebDriver support across various browser vendors is enough to continue most test cases, some region are still not covered, such as application performance statistic or network manipulation.

As part of a, Sauce Labs has free a serial of bid that expand on the types of examination cases that can be covered while testing on our platform.

The release includes a tool that exhibit Chrome ’ s native network manipulation features, but in the form of a WebDriver command. Not alone perform this tool open opportunity to test how the application behaves under various mesh constellation (e.g 3g or 2g speeds) without the need of a 3rd party proxy, but too how the application would respond when the internet connection is cut off. Additionally, since the lineament is implemented on the browser degree, Sauce is able to maintain an active WebDriver/VM connection and countenance for users to perform assertions on the state of the app.

This is an extremely helpful feature for organizations with applications that hold to be employ for a long period of time or remain exposed in the ground while the connecter can be unstable.

In the example below, we check if the offline mode of an coating is working as expected, and if it is capable to easily recover when the connection is re-start.

Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script.

driver.get (& quot; https: //saucecon.herokuapp.com/ & quot;); // Navigating to the page

driver.executeScript (& # x27; sauce: gun & # x27;, {condition: & # x27; offline & # x27;})     .then (driver.get (& quot; https: //saucecon.herokuapp.com/ & quot;)); // Offline Mode ON

driver.findElement (webdriver.By.css (& # x27; # information & gt; p: nth-child (1) & # x27;)) .getText ()     .then (function (mode) {console.log (& quot; Application Status is: & quot; + style) //Checking the app status});

We ’ ve too included a bit of illustration in our (this specific example can be understand by runningnpm run demo: offline )

Note: this feature is included as part of the Sauce Labs Extended Debugging package. In order to access this functionality, you will postulate to get sure that you include‘ extendedDebugging ’: truein your desired capableness.

Since the test is executed on the Sauce Labs Continuous Testing Cloud, you will also have access to the picture of how the covering alteration alongside all of the logs, all of which will help you and your teams name bugs more quickly and deliver calibre codification at the speed your user demand.

Published:
Apr 19, 2018
Share this post
Copy Share Link
LinkedIn
© 2026 Sauce Labs Inc., all rights reserved. SAUCE and SAUCE LABS are register trademarks owned by Sauce Labs Inc. in the United States, EU, and may be registered in other jurisdiction.
robot
quote

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free