Selenium 2.53.0 firefox错误 [英] Selenium 2.53.0 firefox bugging

查看:57
本文介绍了Selenium 2.53.0 firefox错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,当我尝试打开Firefox时,它要么迅速弹出,要么停留一秒钟直到我看到它然后崩溃 另外,我使用硒版本2.53.1

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");

推荐答案

与其他浏览器供应商提供给Selenium的其他驱动程序一样,

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

您需要从此处下载最新的可执行文件 geckodriver,并将此下载路径从您的计算机设置为系统属性,以使用Firefox驱动程序运行测试用例,如下所示:

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");

这篇关于Selenium 2.53.0 firefox错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆