' Use a specific Firefox profileDim profileManager As FirefoxProfileManager = New FirefoxProfileManager()Dim profile As FirefoxProfile = profileManager.GetProfile("HARDDISKUSER")Dim driver As IWebDriver = New FirefoxDriver(profile)' Set a HTTP proxy FirefoxDim firefoxProfile As FirefoxProfile = New FirefoxProfile()firefoxProfile.SetPreference("network.proxy.type", 1)firefoxProfile.SetPreference("network.proxy.http", "myproxy.com")firefoxProfile.SetPreference("network.proxy.http_port", 3239)Dim driver As IWebDriver = New FirefoxDriver(firefoxProfile)' Set a HTTP proxy ChromeDim options As ChromeOptions = New ChromeOptions()Dim proxy = New Proxy()proxy.Kind = ProxyKind.Manualproxy.IsAutoDetect = Falseproxy.HttpProxy = "127.0.0.1:3239"proxy.SslProxy = "127.0.0.1:3239"options.Proxy = proxyoptions.AddArgument("ignore-certificate-errors")Dim driver As IWebDriver = New ChromeDriver(options)' Accept all certificates FirefoxDim firefoxProfile As FirefoxProfile = New FirefoxProfile()firefoxProfile.AcceptUntrustedCertificates = TruefirefoxProfile.AssumeUntrustedCertificateIssuer = FalseDim driver As IWebDriver = New FirefoxDriver(firefoxProfile)' Accept all certificates ChromeDim capability As DesiredCapabilities = DesiredCapabilities.Chrome()Environment.SetEnvironmentVariable("webdriver.chrome.driver", "C:PathToChromeDriver.exe")capability.SetCapability(CapabilityType.AcceptSslCertificates, True)Dim driver As IWebDriver = New RemoteWebDriver(capability)' Set Chrome options.Dim options As ChromeOptions = New ChromeOptions()Dim dc As DesiredCapabilities = DesiredCapabilities.Chrome()dc.SetCapability(ChromeOptions.Capability, options)Dim driver As IWebDriver = New RemoteWebDriver(dc)' Turn off the JavaScript FirefoxDim profileManager As FirefoxProfileManager = New FirefoxProfileManager()Dim profile As FirefoxProfile = profileManager.GetProfile("HARDDISKUSER")profile.SetPreference("javascript.enabled", False)Dim driver As IWebDriver = New FirefoxDriver(profile)' Set the default page load timeoutdriver.Manage().Timeouts().SetPageLoadTimeout(New TimeSpan(10))' Start Firefox with pluginsDim profile As FirefoxProfile = New FirefoxProfile()profile.AddExtension("C:extensionsLocationextension.xpi")Dim driver As IWebDriver = New FirefoxDriver(profile)' Start Chrome with an unpacked extensionDim options As ChromeOptions = New ChromeOptions()options.AddArguments("load-extension=/pathTo/extension")Dim capabilities As DesiredCapabilities = New DesiredCapabilities()capabilities.SetCapability(ChromeOptions.Capability, options)Dim dc As DesiredCapabilities = DesiredCapabilities.Chrome()dc.SetCapability(ChromeOptions.Capability, options)Dim driver As IWebDriver = New RemoteWebDriver(dc)' Start Chrome with a packed extensionDim options As ChromeOptions = New ChromeOptions()options.AddExtension(Path.GetFullPath("localpathto/extension.crx"))Dim capabilities As DesiredCapabilities = New DesiredCapabilities()capabilities.SetCapability(ChromeOptions.Capability, options)Dim dc As DesiredCapabilities = DesiredCapabilities.Chrome()dc.SetCapability(ChromeOptions.Capability, options)Dim driver As IWebDriver = New RemoteWebDriver(dc)' Change the default files’ save locationDim downloadFolderPath = "c:temp"Dim profile As FirefoxProfile = New FirefoxProfile()profile.SetPreference("browser.download.folderList", 2)profile.SetPreference("browser.download.dir", downloadFolderPath)profile.SetPreference("browser.download.manager.alertOnEXEOpen", False)profile.SetPreference("browser.helperApps.neverAsk.saveToDisk", "application/msword, application/binary, application/ris, text/csv, image/png, application/pdf, text/html, text/plain, application/zip, application/x-zip, application/x-zip-compressed, application/download, application/octet-stream");Dim driver As IWebDriver = New FirefoxDriver(profile)