Selenium InternetExplorerDriver代理C#

时间:2019-01-22 16:46:40

标签: selenium internet-explorer proxy

我需要在其他代理上执行测试。为此,我通过以下方式设置InternetExplorerDriver:

        var options = new InternetExplorerOptions();
        Proxy proxy = new Proxy()
        {
            Kind = ProxyKind.Manual,
            HttpProxy = Globals.PROXY_IP + ":" + Globals.PROXY_HTTP_PORT.ToString(),
            SslProxy = Globals.PROXY_IP + ":" + Globals.PROXY_HTTPS_PORT.ToString(),
        };
        string[] bypassAddresses = new string[] { "*portalmail.qc", "*mailportal.qc"};
        proxy.AddBypassAddresses(bypassAddresses);
        options.Proxy = proxy;
        driver = new InternetExplorerDriver("./Resources", options, TimeSpan.FromMinutes(15));

成功设置了Proxy ip:端口,但是未设置Proxy Exception / Bypass(代理例外/绕过)(请勿将代理服务器用于以:开头的地址)。我还尝试设置Proxy.NoProxy(已弃用),但得到了相同的结果。 Proxy.BypassProxyAddresses和Proxy.NoProxy均在bypassAddresses中设置了地址,并且之间以分号分隔,但是由于某些原因,它们不在IE选项的Proxy绕过中

1 个答案:

答案 0 :(得分:0)

是的,这是IE驱动程序中最近修复的错误,请参阅以下GitHub PR: https://github.com/SeleniumHQ/selenium/pull/6483