Selenium 2.53.0 firefox bugging

大憨熊 提交于 2019-12-02 08:53:45

问题


So, when I try to open firefox like it either pops up really quickly, or it just stays there for a second until I can see it then crashes Also, I use selenium version 2.53.1

    WebDriver driver = new FirefoxDriver();
    driver.get("http://stackoverflow.com");

回答1:


Just like the other drivers available to Selenium from other browser vendors, Mozilla has released an executable geckodriver that will run alongside the browser.

You need to download latest executable geckodriver from here and set this downloaded path from your machine as system property to run your test case with Firefox driver as below :

 System.setProperty("webdriver.gecko.driver","path/to downloaded/geckodriver.exe");
 DesiredCapabilities capabilities = DesiredCapabilities.firefox();
 capabilities.setCapability("marionette", true);
 WebDriver driver = new FirefoxDriver(capabilities);
  driver.get("http://stackoverflow.com");


来源:https://stackoverflow.com/questions/38818986/selenium-2-53-0-firefox-bugging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!