0

在 FF22 上运行我的自动化脚本时,使用公司代理网络得到 moz-proxy 提示,上面写着“代理 mox-proxy://proxy.abc.com:8080 正在请求用户名和密码”。护目镜后,我发现下面的一些偏好设置对我不起作用。

FirefoxProfile firefoxProfile = new FirefoxProfile();

            firefoxProfile.setPreference("network.proxy.type",
                    ProxyType.SYSTEM.ordinal());
            firefoxProfile.setPreference("signon.autologin.proxy", true);
            firefoxProfile.setPreference("network.websocket.enabled", false);
            firefoxProfile.setPreference("network.proxy.share_proxy_settings", false);
            firefoxProfile.setPreference("network.automatic-ntlm-auth.allow-proxies", false);
            firefoxProfile.setPreference("network.automatic-ntlm-auth.trusted-uris", "application url");
            firefoxProfile.setPreference("network.negotiate-auth.delegation-uris", "application url");
            firefoxProfile.setPreference("network.negotiate-auth.trusted-uris", "application url");
            firefoxProfile.setEnableNativeEvents(false);
            desiredCapabilities.setCapability(FirefoxDriver.PROFILE,
                    firefoxProfile);

            return new FirefoxDriver(desiredCapabilities);

我正在使用带有 Selenium 2.32 版本的 FF22。

4

0 回答 0