How can I setup Selenium proxy?
Hello Alex,
You can refer to the sample code below to set up Selenium proxy:
/// <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);
}