【发布时间】:2012-01-12 18:59:42
【问题描述】:
我不想为我的办公室网络提供代理设置的用户名/密码,我可以将代理提供给浏览器:
String PROXY = "localhost:8080";
org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setHttpProxy(PROXY)
.setFtpProxy(PROXY)
.setSslProxy(PROXY);
DesiredCapabilities cap = new DesiredCapabailities();
cap.setPreference(CapabilityType.PROXY, proxy);
或
user_pref("network.proxy.http", "127.0.0.1");
user_pref("network.proxy.http_port", 8084);
user_pref("network.proxy.ssl", "127.0.0.1");
user_pref("network.proxy.ssl_port", 8084);
user_pref("network.proxy.no_proxies_on", "localhost:4444");
user_pref("network.proxy.type", 1);
但是,无论我做什么,它仍然要求 Webdriver 的密码。 注意:我可以发送 htmlunit 驱动程序的用户名/密码。请帮忙!
【问题讨论】:
-
寻求专家帮助...
-
我对你有感觉,我也在努力寻找答案,但还没有运气。 @Bijoy,已经一个月了,你知道怎么做吗?希望你能帮助我。
-
在当前 webdriver(使用 firefox 驱动程序)中执行此操作的唯一方法是将这些设置在 firefox 配置文件中,然后使用该配置文件作为启动 webdriver 的源配置文件。实际上,我必须修补 selenium 才能在运行时设置它们。我希望能够在接下来的几天内提取补丁并发布它们
-
现在有什么办法吗?