C# FirefoxProfile cannot be converted to FirefoxOptions

1,503 views
Skip to first unread message

Cole

unread,
Aug 28, 2018, 11:03:15 PM8/28/18
to Selenium Users
Hello. I am having a constant error where it says that my FirefoxProfile cannot be converted to FirefoxOptions. This is the exact error code:

"Argument 1: cannot convert from 'OpenQA.Selenium.Firefox.FirefoxProfile' to 'OpenQA.Selenium.Firefox.FirefoxOptions' "

I am using what is essentially Selenium's code snippet for FirefoxProfile, and yet I cannot find a way around this error. I have double-checked, and the WebDriver.dll, Webdriver.Support.dll, the geckodriver, and my Visual Studio are all up to date. I am using the netstandard2.0 versions of WebDriver.dll and Webdriver.Support.dll if it matters. The full code of my project is below, and I have the Selenium.Support and the Selenium.WebDriver NuGet Packages installed as well. I have attached pictures of my references list and also of the properties of both of the .dll files I mentioned. Let me know if you need any more information of me! Thanks! 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium;

namespace TestCase_XLRoster
{
class Program
{
static void Main(string[] args)
{

FirefoxProfileManager profManager = new FirefoxProfileManager();
FirefoxProfile profile = profManager.GetProfile("SELENIUM");
IWebDriver driver = new FirefoxDriver(profile);
}
}
}
support.png
driver.png
references.png

Jim Evans

unread,
Aug 29, 2018, 6:11:03 AM8/29/18
to Selenium Users
Since the 3.14 release of the .NET bindings, the FirefoxDriver class no longer has a constructor that takes a FirefoxProfile object as an argument. Indeed, such constructors had previously been marked deprecated for a number of releases before removal. The correct approach is to create a FirefoxOptions object, and set the Profile property to the profile you want to use.
Reply all
Reply to author
Forward
0 new messages