Add Plugins / Extensions to Remote Browsers in Automate

You can add extensions to remote Chrome browsers in Automate.


End-users extend browser functionalities with plugins / extensions. For some scenarios, you may need to verify the following:

  1. How your web pages look or behave on browsers with 3rd party plugins / extensions.
  2. How your plugin / extension modifies the appearance or behavior of different webpages. You can add plugins / extensions to remote browsers in BrowserStack Automate.

NOTE: This page shows you how to add extensions to remote Chrome browsers. We’ll update it to include Firefox soon.


First, you’ll need the Chrome extension’s .crx file. To obtain it, follow the steps below:

  1. Find the Extension ID
    • Open Google Chrome browser on your workstation.
    • Open URL: chrome://extensions/. This will show you a list of installed extensions.
    • Tick the Developer Mode checkbox. This will show you the ID of each extension installed on your Chrome browser.
    • Find the extension you want to add on the remote Chrome browser. Copy its extension ID to Notepad.
  2. Locating Extension-version subdirectory
    • Find the extensions directory on your workstation.
    • In the extensions directory, find the subdirectory with the extension’s version number.
    • Copy the path to this extension-version subdirectory and paste it in the Notepad.
  3. Pack extension
    • Go back to Google Chrome extensions page and click ‘Pack extension’.
    • In the dialogue box that pops up, paste the path to the extension-version subdirectory in the “Extension root directory” input field.
    • Click the ‘Pack extension’ button. This will create a .crx file in the extension-version folder.

Copy the path to the extension-version folder (now containing the .crx file). We’ll need this path to configure our Selenium test.

Adding extensions to remote Chrome browser

This section shows you how to use Selenium’s chromeOptions class to add extensions in our remote Chrome browsers.

Add the code snippet below in your test script. This will instruct the remote ChromeDriver to add the specified extension before executing the test:

ChromeOptions options = new ChromeOptions();
options.addExtensions(new File("<path to extension directory>.crx"));
caps.setCapability(ChromeOptions.CAPABILITY, options)
/* You need to use the below modules into your NodeJS test before implementing this code.

var chrome = require("selenium-webdriver/chrome");
var fs = require('fs');


let file_path = '<path to extension directory>.crx';
let buff = new Buffer.from(fs.readFileSync(file_path));
let base64data = buff.toString('base64');

var capabilities = {
  'browserName' : 'Chrome',
  'os' : 'Windows',
  'os_version' : '10',
  'chromeOptions': {
  'extensions' : [ base64data ]

var driver = new webdriver.Builder().
/* You need to use the below packages into your C# test before implementing
this code.

using System.IO;
using System.Collections.Generic;


IWebDriver driver;

Byte[] bytes = File.ReadAllBytes("<path to extension directory>.crx");
String crx_file_base64 = Convert.ToBase64String(bytes);

String[] files_string_array = { crx_file_base64 };

Dictionary<string, object> chromeOptionsD = new Dictionary<string,
chromeOptionsD.Add("extensions", files_string_array);

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.SetCapability("browserName", "Chrome");
capabilities.SetCapability("browserVersion", "75.0");
capabilities.SetCapability("chromeOptions", chromeOptionsD);

driver = new RemoteWebDriver(
	new Uri(""), capabilities
/* Requires PHP Class
You need to use the class "Facebook\WebDriver\Chrome\ChromeOptions" into your PHP test before implementing following code. */

$options = new ChromeOptions();
  '<path to extension directory>.crx',

$caps = array(
    "browser" => "Chrome",
    "os" => "Windows",
    "os_version" => "10",

$web_driver = RemoteWebDriver::create(
chrome_options = Options()
chrome_options.add_extension('<path to extension directory>.crx')
desired_cap = chrome_options.to_capabilities()
    'browser': 'chrome',
    'os': 'Windows',
    'os_version': '10'
caps ="chromeOptions" => {"extensions" => [ Base64.strict_encode64("<path to extension directory>.crx", 'rb').read) ]})
caps['browser'] = 'Chrome'
caps['os'] = 'Windows'
caps['os_version'] = '10'
driver = Selenium::WebDriver.for :remote, url: '', desired_capabilities: caps

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked

Thank you for your valuable feedback