Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/147.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
FirefoxDriver Selenium不工作(Java)_Java_Selenium_Selenium Webdriver_Selenium Firefoxdriver - Fatal编程技术网

FirefoxDriver Selenium不工作(Java)

FirefoxDriver Selenium不工作(Java),java,selenium,selenium-webdriver,selenium-firefoxdriver,Java,Selenium,Selenium Webdriver,Selenium Firefoxdriver,我想用Java中的Selenium设置FirefoxDriver。我试过的方法如下: FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("network.proxy.http", "proxy"); profile.setPreference("network.proxy.http_port", "1234"); WebDriver driver = new FirefoxDr

我想用Java中的Selenium设置FirefoxDriver。我试过的方法如下:

    FirefoxProfile profile = new FirefoxProfile();
    profile.setPreference("network.proxy.http", "proxy");
    profile.setPreference("network.proxy.http_port", "1234");
    WebDriver driver = new FirefoxDriver(profile);

    driver.get("http://www.stackoverflow.com");
但它总是给我一个错误:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
谷歌这之后,原来这是一个常见的问题,但我并没有找到任何解决办法!
我正在使用selenium-server-standalone-2.41.0.jar和Firefox 29.0
谁能帮帮我吗

尝试在firefox浏览器中手动设置代理详细信息,看看您是否能够访问

您的代码看起来不错。我没有注意到您遇到的问题。selenium-server-standalone-2.41.0.jar和Firefox 29.0.1对我来说工作得很好。我建议您用其他版本重新安装Firefox。不幸的是,即使使用较旧的FF版本(建议使用27.0.1),它也不适用于我):(我发现这在另一个系统上运行良好。奇怪。