小编Jef*_*ald的帖子

在C#中使用Selenium WebDriver中的特定Firefox配置文件

我正在尝试使用我已经使用selenium 2为firefox设置的配置文件但是没有C#的文档.我试过的代码如下:

FirefoxProfileManager profileManager = new FirefoxProfileManager();
FirefoxProfile profile = profileManager.GetProfile(profileName);
driver = new FirefoxDriver(profile);
Run Code Online (Sandbox Code Playgroud)

我在Java中看到的代码使用的是使用ProfilesIni而不是FirefoxProfileManager的代码,但这在C#中不可用.以这种方式设置驱动程序时,使用的selenium配置文件具有所有默认设置,而不是我试图指向的配置文件中指定的设置.

我不确定我是否使用正确的方法来检索配置文件,但如果有人使用Selenium 2和C#,任何信息都会有所帮助.

c# firefox selenium webdriver

12
推荐指数
2
解决办法
3万
查看次数

标签 统计

c# ×1

firefox ×1

selenium ×1

webdriver ×1