How to set up Selenium proxy in SpecFlow?
Hello Brettm,
To set up Selenium proxy in SpecFlow, you can refer to the sample code below:
/// <summary>
/// Performs the initialize of the browser.
/// </summary>
/// <param name="driverFolder">The driver folder.</param>
/// <param name="proxy">The proxy.</param>
/// <returns>
/// The web driver.
/// </returns>
protected override IWebDriver PerformInitialize(string driverFolder, Proxy proxy)
{
var options = new ChromeOptions();
if (!string.IsNullOrWhiteSpace(proxy.HttpProxy))
{
options.AddAdditionalCapability(CapabilityType.Proxy, proxy);
}
return new ChromeDriver(driverFolder, options);
}