When the C# test process needs a forward proxy to reach a remote Selenium service, attach a System.Net.WebProxy to its HTTP command executor:

using System;
using System.Net;
using OpenQA.Selenium.Remote;

var commandProxy = new WebProxy("http://proxy.example:8080")
{
    Credentials = proxyCredentials
};
var executor = new HttpCommandExecutor(
    remoteWebDriverUri, TimeSpan.FromSeconds(60))
{
    Proxy = commandProxy
};

using var driver = new RemoteWebDriver(
    executor, browserOptions.ToCapabilities());

proxyCredentials is the intended proxy account, remoteWebDriverUri is the configured remote service URI, and browserOptions contains the existing browser and provider capabilities. Omit Credentials when the intermediary does not require authentication. In that case, the HTTP proxy list supplies candidates if the remote WebDriver service is public and public-proxy access is permitted.

Set the executor property before constructing RemoteWebDriver. Creating the driver starts the remote-session exchange; the executor creates its underlying HTTP client when first needed. A later property change is not a reliable way to replace the handler already used by that client.

This route carries WebDriver commands from the runner to the remote service. The browser’s own website traffic is a separate connection. If it also needs a proxy, configure that through browser capabilities using an endpoint reachable from the browser’s machine.

The proxy credentials authenticate to the intermediary. Remote-service credentials still belong in the provider’s supported login or capability configuration.

Allakkat attuumassuteqartut