Skip to content

Override browser profile preferences, install browser extensions, Headless mode

Jakub Raczek edited this page Jun 26, 2025 · 4 revisions

Our framework supports overriding browser profile preferences set in DriverContext class or adding additional not included in our code, passing arguments to browsers and installing browser extensions. It can be done by adding settings in FirefoxPreferences, FirefoxArguments and FirefoxExtensions or ChromePreferences, ChromeArguments and ChromeExtensions sections of appsettings.json file.

"ChromeArguments": {
    "headless": "",
    "no-sandbox": "",
    "disable-dev-shm-usage": "",
    "whitelisted-ips": ""
  },

To pass arguments to Chrome browser to e.g. start in headless mode add this section to your App.config file

  "ChromeArguments" {
    "headless" :"",
    }

To start e.g. FireFox with FireBug extension copy firebug-x.x.x-fx.xpi file to bin folder of your project and add this section to your App.config file

"FirefoxExtensions"{
    "firebug-2.0.19-fx.xpi" :"",
  }

To overwrite any e.g. Firefox preferences or add new one add this section to your App.config file

 "FirefoxPreferences"{
    "network.automatic-ntlm-auth.trusted-uris" :"servername1,servername2" ,
  }

With the InternetExplorer you can only override EnsureCleanSession and IgnoreZoomLevel preferences, by default both are set to true in DriverContext class.

In order to start FireFox with default firefox profile edit following section in your App.config file, set proper path to FireFox default profile.

"UseDefaultFirefoxProfile" :true,
"PathToFirefoxProfile" :"C:\\\username\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles",

Clone this wiki locally