

ChromeOptions options = new ChromeOptions() Step 4) Instantiate the web driver using the desired capabilities class and Chrome Options in Selenium objectīelow example demonstrates how to activate ad blocker extension on the Chrome browser using Chrome Options and Desired Capabilities class. Step 3) Pass the downloaded CRX File path to Chrome Options class

Step 2) Extract the CRX File corresponding to AdBlocker extension through Step 1) AdBlocker extension must be installed on Chrome browser before using Chrome Options class

Below are the steps to access AdBlocker extension on the Chrome browser using Desired Capabilities class. This property to used to set the browser versionĪdblocker extension of the Chrome browser can be handled using ChromeDriver Options and Desired Capabilities class. This property is used to set the browser name for a web driver instance This property is used to set the operating system platform used to access the web site This property tells the browser to accept SSL Certificates by default

We need to pass an instance of ChromeOptions class to the web driver initialization. It helps you perform various operations like opening Chrome in maximized mode, disable existing extensions, disable pop-ups, etc.īelow example shows a way to open Chrome browser in maximized mode using ChromeOptions class. The Chrome options class is generally used in conjunction with Desired Capabilities for customizing Chrome driver sessions. The Chromeoptions Class is a concept in Selenium WebDriver for manipulating various properties of the Chrome driver.
