Java 我无法使用驱动程序打开URL。请在selenium web驱动程序中获取(“URL”)

Java 我无法使用驱动程序打开URL。请在selenium web驱动程序中获取(“URL”),java,selenium,selenium-webdriver,automation,webdriver,Java,Selenium,Selenium Webdriver,Automation,Webdriver,我无法在使用firefox版本49.0.1的selenium web驱动程序中使用driver.get(“URL”)打开URL。 我得到的错误是: org.openqa.selenium.firefox.NotConnectedException:45000毫秒后无法连接到端口7055上的主机127.0.0.1。firefox控制台输出 您需要从link下载geckodriver.exe,没有gecko驱动程序,您无法运行firefox 49.0。下载后,将其解压缩并存储在计算机上的任何位置,然

我无法在使用firefox版本49.0.1的selenium web驱动程序中使用driver.get(“URL”)打开URL。 我得到的错误是:

org.openqa.selenium.firefox.NotConnectedException:45000毫秒后无法连接到端口7055上的主机127.0.0.1。firefox控制台输出


您需要从link下载
geckodriver.exe
,没有gecko驱动程序,您无法运行firefox 49.0。下载后,将其解压缩并存储在计算机上的任何位置,然后按照以下代码进行操作。为此,请使用Selenium版本3.0.1。 如果您使用的是旧版本的selenium,则必须使用

WebDriver driver = new MarionetteDriver(); 
代替

WebDriver driver = new FirefoxDriver();
从以下链接下载gecko驱动程序:


添加更多详细信息,您是否面临任何错误?是。我得到的PFB错误。“org.openqa.selenium.firefox.NotConnectedException:45000毫秒后无法连接到端口7055上的主机127.0.0.1。firefox控制台输出”我想您使用的是旧的selenium jar文件,请更新到最新的文件,并使用
geckodriver
连接firefox。这对我来说很好。它是否适用于mozilla 49.o的更高版本。我还想知道为什么要使用geckodriver.exe(适用于49个以上版本的mozilla)和WebDriver driver=new-marionetedriver();(对于较旧的selenium版本)?
System.setProperty("webdriver.gecko.driver","C:\\Selenium\\Firefox driver\\geckodriver.exe"); // you have to select you path of gecko driver where you placed it after download and unzip.
WebDriver driver = new FirefoxDriver();

driver.get("http://www.hotmail.com");