---
title: Puppeteer Options - Customize Puppeteer | TestingBot
description: 'All Puppeteer tb:options capabilities for the TestingBot cloud: name,
  build, group, custom data, tunnel identifier, screen resolution, timezone, geolocation,
  network conditions and more.'
source_url:
  html: https://testingbot.com/support/web-automate/puppeteer/options
  md: https://testingbot.com/support/web-automate/puppeteer/options/index.md
---
# Puppeteer Options

This page lists various options that you can use to customise your Puppeteer sessions on TestingBot.

The [Puppeteer Capabilities generator](https://testingbot.com/support/web-automate/puppeteer/capabilities) allows you to easily generate the necessary capabilities for your tests.

## Basic Settings

### Browser Name

The name of the browser to run your Puppeteer test on. TestingBot currently supports these browserNames:

- **Chrome**
- **Edge**
- **Firefox**

[Chrome](https://testingbot.com#)[Edge](https://testingbot.com#)[Firefox](https://testingbot.com#)

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'edge',
      browserVersion: 'latest'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'firefox',
      browserVersion: 'latest'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

### Browser Version

The version of the browser to run your Puppeteer test on.

  ![OS selected](https://testingbot.com/assets/environments/svg/windows11-0e1b28bc0fdd5034d3e4d3dc8d346c500a8c6522facf4b45d0da56537c1f1c6d.svg) Windows 11 › ![Browser selected](https://testingbot.com/assets/environments/svg/chrome-c4081ff447d2d898d4afcb8f074a907c960e6f007716c1a1d119eee6803c4042.svg) Chrome 139 

Loading environments...

Please wait while we load the available browsers and platforms.

    

Other Options:
- `"version": "*"` : If you use `*` as version, TestingBot will pick a random version. 
- `"version": "latest"` : TestingBot will automatically take the latest version. You can also use `latest-1`, `latest-2`, ... to test on the next most recent versions. For example, if the current latest Chrome version is 89 and you use `latest-2`, then the test will run on Chrome 87. 
- `"version": "<=16"` : TestingBot will pick a version smaller than or equal to the version you specify with `<=`.   
`"version": ">=16"` : TestingBot will pick a version higher than or equal to the version you specify with `>=`. 

### Browser Platform

The OS/platform for the test VM which will run the Puppeteer test.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      platform: 'WIN11'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

Possible values:
- `WIN11`
- `WIN10`
- `TAHOE`
- `SEQUOIA`
- `SONOMA`
- `VENTURA`
- `MONTEREY`
- `BIGSUR`
- `LINUX`

### Make a video of your tests

By default we record a video of your test, which is accessible in the member area. If you do not wish to have this, you can disable it with this option.   
 Video should not slow down your test considerably.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      screenRecorder: false
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

 Value Type | Default Value || boolean | true |

### Test Privacy

Make the test results for this test public so that everyone can access the results.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      public: true
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

 Value Type | Default Value || boolean | false |

### Blacklist hostnames

The hostnames you specify will be pointed to localhost instead of their real destination. This means you can speed up tests by blocking third party content which you don't need and slows down your test.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      blacklist: 'site1.com,site2.com'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

 Value Type || string (comma-separated) |

### Customize Logging

By default, TestingBot records logs of all Puppeteer actions.

Set this option to `false` if you don't want TestingBot to record anything (for example, if you have sensitive data).

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      recordLogs: true
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

 Value Type | Default Value | Possible Values: || boolean | true | `true`, `false` |

### Custom Time Zones

Change the Time Zone of the Virtual Machine to the Time Zone you specify. You can find a [list of timezones on Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). Only location names are supported (not their paths). See some examples below:

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      timeZone: 'Etc/UTC'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

 Value Type | Default Value | Possible Values: || string | "Etc/UTC" | [List of timezones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) |

### Change Screen Resolution

Will adjust the screen resolution before your test.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      'screen-resolution': '1280x1024'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

 Value Type | Default Value | || string | "1280x1024" | 

 Platform | Resolutions || Windows/Linux | 

- 800x600 
- 1024x768 
- 1152x864 
- 1280x768 
- 1280x800 
- 1280x960 

- 1280x1024 
- 1400x1050 
- 1600x1200 
- 1680x1050 
- 1920x1080 
- 1920x1200 
- 2560x1440 

 |
| macOS | 

- 800x600
- 1024x768
- 1280x768
- 1280x800
- 1280x960

- 1280x1024
- 1366x768
- 1440x900
- 1600x900
- 1600x1200

- 1680x1050
- 1920x1080
- 1920x1200
- 2048x1536

 |

 |

### Geolocation Testing

We provide an option where you can specify from which country you'd like to run the test from.

Once you specify this option, the virtual machine we provision for your test will be configured to use a proxy in the country you specified.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      geoCountryCode: 'US'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

We currently support the following country codes:

- **'\*'** : this will take a random country from the list below
- **'AU'** : Australia
- **'BE'** : Belgium
- **'BR'** : Brazil
- **'CA'** : Canada
- **'CL'** : Chile
- **'FR'** : France
- **'DE'** : Germany
- **'IN'** : India
- **'IT'** : Italy
- **'JP'** : Japan
- **'NO'** : Norway
- **'SG'** : Singapore
- **'ZA'** : South Africa
- **'SE'** : Sweden
- **'CH'** : Switzerland
- **'AE'** : United Arab Emirates
- **'GB'** : United Kingdom
- **'US'** : United States

### Upload

This option allows you to upload a file to the test VM running the Puppeteer test.   
 TestingBot will first download the file from the URL you specified and save it on the test VM so your test can use the file.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      upload: 'https://testingbot.com/assets/logo-head.png',
      uploadFilepath: '/tmp/test.png'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })
    
    const page = await browser.newPage()
    await page.goto('http://localhost:3000')
    const elementHandle = await page.$('input[type=file]')
    await elementHandle.uploadFile('/tmp/test.png')
    await page.click('upload-button')
    await browser.close()

You need specify the download URL as `upload` and use `uploadFilepath` to indicate where TestingBot needs to put the file.

### Change Test Name

Add a name to this test, which will show up in our member area and API.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      name: 'First Test'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

 Value Type | Default Value || string | unnamed test |

### Group Tests

A key you can use to group certain tests in the same build (for example in Jenkins).   
 The builds will appear in our member area.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      build: 'First Build'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

 Value Type || string |

### Timeout

Controls the timeout setting of a Puppeteer session. This setting, which is specified in seconds, controls when a session times out.

A timeout occurs when a session has not received any commands from your Puppeteer test for the amount of seconds specified (default is 90 seconds).   
 If a certain Puppeteer command takes longer than the specified setting, the session will automatically close.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      timeout: 90
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

 Value Type | Default Value || int (specify number of seconds) | 90 seconds |

### Idle Timeout

The maximum amount of time a browser will wait before proceeding to the next step in your test.

A timeout occurs when a session has not received any commands from your Puppeteer test for the xx amount of seconds specified.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET,
        timeout: 120000
      },
      browserName: 'chrome',
      browserVersion: 'latest'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

 Value Type | Default Value || int (specify number of seconds) | 90 seconds |

### Maximum Test Duration

The maximum duration for a single test. This is a safeguard to prevent bad tests from using up your credits.

We generally recommend to keep tests short (less than 10 minutes). It's better to split up large tests in smaller individual tests.   
 This keeps your tests fast and allows for more parallelization of your tests.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      maxDuration: 1800
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

 Value Type | Default Value || int (specify number of seconds) | 1800 seconds (30 minutes) |

### Custom Metadata

Send along custom data, for example your release, server, commit hash, ...   
 This will show up on the test detail page in the TestingBot member area.

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      extra: 'Extra Information'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })

 Value Type || string |

### Startup Flags

You can customize the startup flags of the browser by passing in extra flags.

This is identical to passing `args` with Puppeteer.

    const startupFlags = []
    startupFlags.push('--window-size=1280,720')
    startupFlags.push('--hide-scrollbars')
    
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com` +
      `?key=API_KEY&secret=API_SECRET&browserName=chrome&startupFlags=${JSON.stringify(startupFlags)}`
    })
    
    const page = await browser.newPage()
    await page.goto('https://testingbot.com')
    await browser.close()

### TestingBot Tunnel

You can specify the `tunnelIdentifier` to [use Puppeteer with TestingBot Tunnel](https://testingbot.com/support/web-automate/puppeteer#tunnel).

    const puppeteer = require('puppeteer')
    const capabilities = {
      'tb:options': {
        key: process.env.TB_KEY,
        secret: process.env.TB_SECRET
      },
      browserName: 'chrome',
      browserVersion: 'latest',
      tunnelIdentifier: 'myPuppeteerTunnel'
    }
    const browser = await puppeteer.connect({
      browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
    })
    
    const page = await browser.newPage()
    await page.goto('http://localhost:3000')
    await page.screenshot({ path: 'screenshot.png' })
    await browser.close()

By default we support proxying these ports for localhost testing: `[443, 80, 8080, 3030, 3000, 3001, 3400]`.   
 If you need additional ports, please pass an array of port numbers to either `localHttpPorts` or `localHttpsPorts`

### Looking for more help?

Have questions or need more information? Reach out via email or Slack.

[Email us](https://testingbot.com/contact/new)[Slack Join our Slack](https://join.slack.com/t/testingb0t/shared_invite/zt-3bcw9xch-jk19~6XPs_xBrsAgAedkCw)
