-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProgram.cs
28 lines (25 loc) · 901 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using OpenQA.Selenium;
using OpenQA.Selenium.Edge;
namespace SeleniumProxyAuthentication.Sample
{
public record Program
{
private static readonly EdgeOptions EdgeOptions = new();
public static void Main()
{
try
{
// with proxy credential
EdgeOptions.AddProxyAuthenticationExtension(new Proxy(ProxyProtocols.HTTP, "proxy_server:proxy_port:proxy_username:proxy_password"));
// without proxy credential
//EdgeOptions.AddProxyAuthenticationExtension(new Proxy(ProxyProtocols.HTTP, "proxy_server:proxy_port"));
IWebDriver driver = new EdgeDriver(EdgeOptions);
driver.Navigate().GoToUrl(new Uri("https://myip.ms"));
}
finally
{
EdgeOptions.DeleteExtensionsCache();
}
}
}
}