c# Selenium 2.53 moving to marionette driver after firefox upgrade to 47

前端 未结 3 1731
死守一世寂寞
死守一世寂寞 2020-12-18 13:09

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 instr

3条回答
  •  长情又很酷
    2020-12-18 13:16

    First of all, you need to add the driver to your system path, not as an env variable. Second, you need to set the flag in a desired capability, not a Firefox option. See: Marionette Webdriver

    As such for remote webdriver:

    DesiredCapabilities capabilities = DesiredCapabilities.Firefox();  
    capabilities.SetCapability("marionette", true); 
    var driver = new RemoteWebDriver(capabilities); 
    

    To add the webdriver to your windows path:

    The easiest way is to open the start menu > search for environment > open edit the system environment variables > click on environment variables > search in the list for Path > click on edit > add ;C:\path\to\webdriver\location\wires.exe to the end and click save.

    For your local (non-webdriver) tests you are right, you can run your webdriver using the following:

    var driver = new FirefoxDriver(new FirefoxOptions());

    You should not have to use

    option1.IsMarionette = true; option1.AddAdditionalCapability("marionette", true);

    If you have set the driver path correctly in your path environment variable.

提交回复
热议问题