The Sauce Labs Cookbook

Sauce Headless

Front End Performance Testing


External Resources

More Info

Page tree
Skip to end of metadata
Go to start of metadata

By adding the extendedDebugging capability to your Selenium test script, you can collect the console logs and HTTP Archive files generated during testing for use in debugging and build performance evaluation.

NOTE: When you use  the extendedDebugging capability, your tests will generate additional assets which could impact test performance. 

See the following sections for more information: 

For Chrome and Firefox Only

This feature is officially supported on the last 5 versions of Chrome browsers, and Firefox browsers versions 53 and above.

What You'll Need

  • Support is only available for the last 5 versions of Chrome browser or Firefox browsers versions 53 and above.

NOTEextendedDebugging is not supported with Headless. 

Enabling Extended Debugging

To generate the JS console logs and HAR files, you need to add the extendedDebugging capability to the desired capabilities of your test:

extendedDebugging : true

Once the test completes, you can access the logs and files through the Sauce Labs application or with the REST API.

Additional Settings for Using Custom Firefox Profiles with Extended Debugging

You must make these additional changes in order to use a custom Firefox profile with extended debugging:

  1. In your Firefox about:config, configure these settings:
    • true
    • devtools.debugger.prompt-connection: false
    • devtools.debugger.remote-enabled: true
  2. Enable Firefox debugging as a  desired capability for your test:
    • "moz:firefoxOptions": {
                "args": [

JavaScript (JS) Console Logs

The JS console collects security errors, warnings, and messages that are explicitly logged by the browser. You can use these logs to find out which components of your web application failed to load or ran into an error, what warnings were logged by the browser, and get more information about application performance. The console log information is associated with the URL where it occurred, and is composed of four types of information: Log, Info, Warning, Error. In this example, you can see how an error was generated for the URL when a resource failed to load:

         "text":"Failed to load resource: the server responded with a status of 404 (OK)",

Accessing Console Logs

You can access the JS Console logs (console.json) under the Logs tab of the Test Details page in Sauce Labs, or through the REST API through the assets endpoint:


The topics in The Sauce Labs REST API contain more information about accessing the API, authentication, and available methods. 

HTTP Archive Format (HAR) Files

HAR files collect all the network requests and responses made and received by the browser during testing. You can refer to HAR files for useful debugging information, including identifying browser requests that time out, pinpointing requests slowing down the loading process, and locating faulty API calls. 

HAR Files Viewer Required

You will need a .HAR viewer to read the files. Two common applications are:

Accessing HAR Files

You can download HAR files from the Metadata tab of the Test Details page in Sauce Labs, or through the REST API through the assets endpoint:

curl -O
curl -O

The topics in The Sauce Labs REST API contain more information about accessing the API and available methods.