我正在尝试使用已经设置好的Firefox配置文件来使用selenium 2,但是没有C#的文档。我尝试过的代码如下:
FirefoxProfileManager profileManager = new FirefoxProfileManager();
FirefoxProfile profile = profileManager.GetProfile(profileName);
driver = new FirefoxDriver(profile);
我在Java中见过使用ProfilesIni而不是FirefoxProfileManager的代码,但这在C#中不可用。使用这种方式设置驱动程序时,所使用的Selenium配置文件将具有所有默认设置,而不是我尝试指向的配置文件中指定的设置。
我不确定我是否正在使用正确的方法来检索配置文件,但如果有人在C#中使用Selenium 2,任何信息都会很有帮助。