1
我編寫了打開Google的selenuim代碼,將一些搜索條件發送到引擎並在結果頁面中單擊特定鏈接。一切都很好,但如果我在大多數情況下將代理設置設置爲firefox,webDriver會非常緩慢地打開谷歌,一切都停在這裏。 WebDriver找不到google的搜索輸入和代碼停止。selenuim在使用代理設置時會停止工作
這裏是設置代理碼設置
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.proxy.type", 1);
profile.setPreference("network.proxy.http","some Proxy");
profile.setPreference("network.proxy.http_port", port);
driver = new FirefoxDriver(profile);
我不明白爲什麼當我使用代理的webdriver無法正常工作。