c#Selenium 2.53在火狐升级到47之后移动到木偶司机 [英] c# Selenium 2.53 moving to marionette driver after firefox upgrade to 47

查看:212
本文介绍了c#Selenium 2.53在火狐升级到47之后移动到木偶司机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用硒进入升级后的Firefox浏览器自动化。硒似乎需要牵线木偶继续工作。我遵循了开发者设置的指令,


  1. 下载了驱动程序
  2. 将其重命名为wire。


    下面的代码没有设法正确地将PATH设置为自定义路径。



    System.Environment.SetEnvironmentVariable(webdriver.gecko.driver,@C:\DOWNLOADS\wires.exe)

    所以我加了wires.exe到debug \ bin文件夹,然后wires.exe工作正常,但我得到以下错误:
    $ b


    系统。 InvalidOperationException被捕获Message =实体未找到Source = WebDriver

    这是我用来启动webdriver的代码

      FirefoxOptions option1 = new FirefoxOptions(); 
    option1.IsMarionette = true;
    option1.AddAdditionalCapability(marionette,true);
    driver = new FirefoxDriver(option1);


    解决方案

    我也得到了 使用FirefoxDriver(新的FirefoxOptions())找不到实体 错误。它似乎是在C:\ Program Files(x86)\Nightly寻找firefox.exe并没有找到它。我发现这个工作:

    $ p $ FirefoxDriverService服务= FirefoxDriverService.CreateDefaultService();
    service.FirefoxBinaryPath = @C:\程序文件(x86)\ Mozilla Firefox \ firefox.exe;
    IWebDriver驱动程序=新的FirefoxDriver(服务);


    I am trying to move into the upgraded firefox web browser automation using selenium. It seems that selenium needs marionette driver to continue working. I followed the instructions set by the devs,

    1. downloaded the driver
    2. renamed it to wires.exe

    The following code didnt manage to properly set the PATH to a custom path.

    System.Environment.SetEnvironmentVariable("webdriver.gecko.driver", "@C:\DOWNLOADS\wires.exe")

    so i added wires.exe to the debug\bin folder and then wires.exe worked properly but i got the following error

    System.InvalidOperationException was caught Message=entity not found Source=WebDriver

    this is the code i use to start webdriver

    FirefoxOptions option1 = new FirefoxOptions();
    option1.IsMarionette = true;
    option1.AddAdditionalCapability("marionette", true);
    driver = new FirefoxDriver(option1);
    

    解决方案

    I too got the "Entity Not Found" error using FirefoxDriver(new FirefoxOptions()). It appears to be looking for firefox.exe in C:\Program Files (x86)\Nightly and not finding it. I found this working :

    FirefoxDriverService service = FirefoxDriverService.CreateDefaultService();
    service.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";
    IWebDriver driver = new FirefoxDriver(service);
    

    这篇关于c#Selenium 2.53在火狐升级到47之后移动到木偶司机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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